Class Verifier

  • All Implemented Interfaces:
    Constants, Registry, aQute.service.reporter.Report, aQute.service.reporter.Reporter, java.io.Closeable, java.lang.AutoCloseable, java.lang.Iterable<java.lang.String>

    public class Verifier
    extends Processor
    • Field Detail

      • EES

        public static final java.lang.String[] EES
      • ReservedFileNames

        public static final java.util.regex.Pattern ReservedFileNames
      • TOKEN

        public static final java.util.regex.Pattern TOKEN
      • EXTENDED_P

        public static final java.util.regex.Pattern EXTENDED_P
      • QUOTEDSTRING_P

        public static final java.util.regex.Pattern QUOTEDSTRING_P
      • ARGUMENT_P

        public static final java.util.regex.Pattern ARGUMENT_P
      • SYMBOLICNAME_STRING

        public static final java.lang.String SYMBOLICNAME_STRING
        See Also:
        Constant Field Values
      • SYMBOLICNAME

        public static final java.util.regex.Pattern SYMBOLICNAME
      • VERSION

        public static final java.util.regex.Pattern VERSION
      • VERSION_P

        public static final java.util.regex.Pattern VERSION_P
      • VERSIONRANGE

        public static final java.util.regex.Pattern VERSIONRANGE
      • VERSIONRANGE_P

        public static final java.util.regex.Pattern VERSIONRANGE_P
      • ISO639

        public static final java.util.regex.Pattern ISO639
      • HEADER_PATTERN

        public static final java.util.regex.Pattern HEADER_PATTERN
      • NUMBERPATTERN

        public static final java.util.regex.Pattern NUMBERPATTERN
      • FLOATPATTERN

        public static final java.util.regex.Pattern FLOATPATTERN
      • BOOLEANPATTERN

        public static final java.util.regex.Pattern BOOLEANPATTERN
      • PACKAGEPATTERN

        public static final java.util.regex.Pattern PACKAGEPATTERN
      • PACKAGEPATTERN_OR_EMPTY

        public static final java.util.regex.Pattern PACKAGEPATTERN_OR_EMPTY
      • MULTIPACKAGEPATTERN

        public static final java.util.regex.Pattern MULTIPACKAGEPATTERN
      • PATHPATTERN

        public static final java.util.regex.Pattern PATHPATTERN
      • FQNPATTERN

        public static final java.util.regex.Pattern FQNPATTERN
      • URLPATTERN

        public static final java.util.regex.Pattern URLPATTERN
      • ANYPATTERN

        public static final java.util.regex.Pattern ANYPATTERN
      • FILTERPATTERN

        public static final java.util.regex.Pattern FILTERPATTERN
      • TRUEORFALSEPATTERN

        public static final java.util.regex.Pattern TRUEORFALSEPATTERN
      • WILDCARDNAMEPATTERN

        public static final java.util.regex.Pattern WILDCARDNAMEPATTERN
      • BUNDLE_ACTIVATIONPOLICYPATTERN

        public static final java.util.regex.Pattern BUNDLE_ACTIVATIONPOLICYPATTERN
      • OSNAMES

        public static final java.lang.String[] OSNAMES
      • PROCESSORNAMES

        public static final java.lang.String[] PROCESSORNAMES
    • Constructor Detail

      • Verifier

        public Verifier​(Jar jar)
                 throws java.lang.Exception
        Throws:
        java.lang.Exception
      • Verifier

        public Verifier​(Analyzer analyzer)
                 throws java.lang.Exception
        Throws:
        java.lang.Exception
    • Method Detail

      • verifyNative

        public void verifyNative()
      • doNative

        public void doNative​(java.lang.String nc)
      • verifyFilter

        public boolean verifyFilter​(java.lang.String value)
      • validateFilter

        public static java.lang.String validateFilter​(java.lang.String value)
      • verify

        public void verify()
                    throws java.lang.Exception
        Throws:
        java.lang.Exception
      • verifyActivationPolicy

        public boolean verifyActivationPolicy()
      • verifyActivationPolicy

        public boolean verifyActivationPolicy​(java.lang.String policy)
      • verifyBundleClasspath

        public void verifyBundleClasspath()
      • isBsn

        public static boolean isBsn​(java.lang.String name)
        Parameters:
        name - the String to test
        Returns:
        true if the given name matches a Bundle Symbolic Name, otherwise false
      • verifyFilter

        public static int verifyFilter​(java.lang.String expr,
                                       int index)
                 filter ::= ’(’ filter-comp ’)’
                 filter-comp ::= and | or | not | operation
                 and ::= ’&’ filter-list
                 or ::= ’|’ filter-list
                 not ::= ’!’ filter
                 filter-list ::= filter | filter filter-list
                 operation ::= simple | present | substring
                 simple ::= attr filter-type value
                 filter-type ::= equal | approx | greater | less
                 equal ::= ’=’
                 approx ::= ’˜=’
                 greater ::= ’>=’
                 less ::= ’<=’
                 present ::= attr ’=*’
                 substring ::= attr ’=’ initial any final
                 inital ::= () | value
                 any ::= ’*’ star-value
                 star-value ::= () | value ’*’ star-value
                 final ::= () | value
                 value ::= <see text>
         
        Parameters:
        expr - the String to test
        index - the index within expr to start with
        Returns:
        the index of the last character within expr that was evaluated
      • isVersion

        public static boolean isVersion​(java.lang.String version)
      • isIdentifier

        public static boolean isIdentifier​(java.lang.String value)
      • isMember

        public static boolean isMember​(java.lang.String value,
                                       java.lang.String[] matches)
      • isFQN

        public static boolean isFQN​(java.lang.String name)
      • verifyChecksums

        public void verifyChecksums​(boolean all)
                             throws java.lang.Exception
        Verify the checksums from the manifest against the real thing.
        Parameters:
        all - true if each resource must be digested, otherwise false
        Throws:
        java.lang.Exception
      • isExtended

        public static boolean isExtended​(java.lang.String key)
        Verify the EXTENDED_S syntax
        Parameters:
        key - the String to test
        Returns:
        true if the given String matches the EXTENDED_S syntax, otherwise false
      • isArgument

        public static boolean isArgument​(java.lang.String arg)
        Verify the ARGUMENT_S syntax
        Parameters:
        arg - the String to test
        Returns:
        true if the given String matches the ARGUMENT_S syntax, otherwise false
      • isQuotedString

        public static boolean isQuotedString​(java.lang.String s)
        Verify the QUOTEDSTRING syntax
        Parameters:
        s - the String to test
        Returns:
        true if the given String matches the QUOTEDSTRING syntax, otherwise false
      • isVersionRange

        public static boolean isVersionRange​(java.lang.String range)
        Verify the VERSION_RANGE_S syntax
        Parameters:
        range - the String to test
        Returns:
        true if the given String matches the VERSION_RANGE_S syntax, otherwise false
      • verifyMetaPersistence

        public void verifyMetaPersistence()
                                   throws java.lang.Exception
        Verify the Meta-Persistence header
        Throws:
        java.lang.Exception
      • isFrombuilder

        public boolean isFrombuilder()
        Returns:
        the frombuilder
      • setFrombuilder

        public void setFrombuilder​(boolean frombuilder)
        Parameters:
        frombuilder - the frombuilder to set
      • isNumber

        public static boolean isNumber​(java.lang.String number)
      • isSpaceSeparated

        public static boolean isSpaceSeparated​(java.lang.String r)
        The -runvm header is often wrongly used as a space separated header instead of a properties. This checks if a header uses commas to separate the parts or spaces.
        Parameters:
        r - a header
        Returns:
        true if spaces are used for separation, false if 1 parameter or commas used