Package net.sourceforge.jnlp
Class JNLPMatcher
- java.lang.Object
-
- net.sourceforge.jnlp.JNLPMatcher
-
public final class JNLPMatcher extends java.lang.ObjectTo compare launching JNLP file with signed APPLICATION.JNLP or APPLICATION_TEMPLATE.jnlp.Used by net.sourceforge.jnlp.runtime.JNLPCLassLoader
-
-
Field Summary
Fields Modifier and Type Field Description private XmlNodeappTemplateNodeprivate booleanisTemplateprivate XmlNodelaunchJNLPNodeprivate static LoggerLOG
-
Constructor Summary
Constructors Constructor Description JNLPMatcher(java.io.InputStream appTemplate, java.io.InputStream launchJNLP, boolean isTemplate, ParserSettings p)Public constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidcloseInputStream(java.io.InputStream stream)Closes an input streamprivate voidcloseOutputStream(java.io.OutputStream stream)Closes an output streambooleanisMatch()Compares both JNLP filesprivate booleanmatchAttributes(XmlNode templateNode, XmlNode launchNode)Compares attributes of twoNodesregardless of orderprivate booleanmatchNodes(XmlNode appTemplate, XmlNode launchJNLP)Compares two Nodes regardless of the order of their children/attributes
-
-
-
Constructor Detail
-
JNLPMatcher
public JNLPMatcher(java.io.InputStream appTemplate, java.io.InputStream launchJNLP, boolean isTemplate, ParserSettings p) throws JNLPMatcherExceptionPublic constructor- Parameters:
appTemplate- the reader stream of the signed APPLICATION.jnlp or APPLICATION_TEMPLATE.jnlplaunchJNLP- the reader stream of the launching JNLP fileisTemplate- a boolean that specifies if appTemplateFile is a templatep- settings of parser- Throws:
JNLPMatcherException- if IOException, XMLParseException is thrown during parsing; Or launchJNLP/appTemplate is null
-
-
Method Detail
-
isMatch
public boolean isMatch()
Compares both JNLP files- Returns:
- true if both JNLP files are 'matched', otherwise false
-
matchNodes
private boolean matchNodes(XmlNode appTemplate, XmlNode launchJNLP)
Compares two Nodes regardless of the order of their children/attributes- Parameters:
appTemplate- signed application or template's NodelaunchJNLP- launching JNLP file's Node- Returns:
- true if both Nodes are 'matched', otherwise false
-
matchAttributes
private boolean matchAttributes(XmlNode templateNode, XmlNode launchNode)
Compares attributes of twoNodesregardless of order
-
closeInputStream
private void closeInputStream(java.io.InputStream stream)
Closes an input stream- Parameters:
stream- The input stream that will be closed
-
closeOutputStream
private void closeOutputStream(java.io.OutputStream stream)
Closes an output stream- Parameters:
stream- The output stream that will be closed
-
-