Class JNLPMatcher

java.lang.Object
net.sourceforge.jnlp.JNLPMatcher

public final class JNLPMatcher extends Object
To compare launching JNLP file with signed APPLICATION.JNLP or APPLICATION_TEMPLATE.jnlp.

Used by net.sourceforge.jnlp.runtime.JNLPCLassLoader

  • Field Details

    • LOG

      private static final Logger LOG
    • appTemplateNode

      private final XmlNode appTemplateNode
    • launchJNLPNode

      private final XmlNode launchJNLPNode
    • isTemplate

      private final boolean isTemplate
  • Constructor Details

    • JNLPMatcher

      public JNLPMatcher(InputStream appTemplate, InputStream launchJNLP, boolean isTemplate, ParserSettings p) throws JNLPMatcherException
      Public constructor
      Parameters:
      appTemplate - the reader stream of the signed APPLICATION.jnlp or APPLICATION_TEMPLATE.jnlp
      launchJNLP - the reader stream of the launching JNLP file
      isTemplate - a boolean that specifies if appTemplateFile is a template
      p - settings of parser
      Throws:
      JNLPMatcherException - if IOException, XMLParseException is thrown during parsing; Or launchJNLP/appTemplate is null
  • Method Details

    • 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 Node
      launchJNLP - 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 two Nodes regardless of order
      Parameters:
      templateNode - signed application or template's XmlNode with attributes
      launchNode - launching JNLP file's XmlNode with attributes
      Returns:
      true if both Nodes have 'matched' attributes, otherwise false
    • closeInputStream

      private void closeInputStream(InputStream stream)
      Closes an input stream
      Parameters:
      stream - The input stream that will be closed
    • closeOutputStream

      private void closeOutputStream(OutputStream stream)
      Closes an output stream
      Parameters:
      stream - The output stream that will be closed