Class JarScanner


  • @Deprecated
    public abstract class JarScanner
    extends PatternMatcher
    Deprecated.
    Does not handle MR Jars
    JarScannerConfiguration Abstract base class for configurations that want to scan jars in WEB-INF/lib and the classloader hierarchy. Jar name matching based on regexp patterns is provided. Subclasses should implement the processEntry(URL jarUrl, JarEntry entry) method to handle entries in jar files whose names match the supplied pattern.
    • Constructor Summary

      Constructors 
      Constructor Description
      JarScanner()
      Deprecated.
       
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      void matched​(java.net.URI uri)
      Deprecated.
       
      abstract void processEntry​(java.net.URI jarUri, java.util.jar.JarEntry entry)
      Deprecated.
       
      void scan​(java.util.regex.Pattern pattern, java.lang.ClassLoader loader, boolean isNullInclusive, boolean visitParent)
      Deprecated.
      Find jar names from the classloader matching a pattern.
      void scan​(java.util.regex.Pattern pattern, java.net.URI[] uris, boolean isNullInclusive)
      Deprecated.
      Find jar names from the provided list matching a pattern.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • JarScanner

        public JarScanner()
        Deprecated.
    • Method Detail

      • processEntry

        public abstract void processEntry​(java.net.URI jarUri,
                                          java.util.jar.JarEntry entry)
        Deprecated.
      • scan

        public void scan​(java.util.regex.Pattern pattern,
                         java.net.URI[] uris,
                         boolean isNullInclusive)
                  throws java.lang.Exception
        Deprecated.
        Find jar names from the provided list matching a pattern. If the pattern is null and isNullInclusive is true, then all jar names will match. A pattern is a set of acceptable jar names. Each acceptable jar name is a regex. Each regex can be separated by either a "," or a "|". If you use a "|" this or's together the jar name patterns. This means that ordering of the matches is unimportant to you. If instead, you want to match particular jar names, and you want to match them in order, you should separate the regexs with "," instead. Eg "aaa-.*\\.jar|bbb-.*\\.jar" Will iterate over the jar names and match in any order. Eg "aaa-*\\.jar,bbb-.*\\.jar" Will iterate over the jar names, matching all those starting with "aaa-" first, then "bbb-".
        Parameters:
        pattern - the pattern to use for jar matching
        uris - the uris of the jars to scan
        isNullInclusive - if true, an empty pattern means all names match, if false, none match
        Throws:
        java.lang.Exception - if unable to scan
      • scan

        public void scan​(java.util.regex.Pattern pattern,
                         java.lang.ClassLoader loader,
                         boolean isNullInclusive,
                         boolean visitParent)
                  throws java.lang.Exception
        Deprecated.
        Find jar names from the classloader matching a pattern. If the pattern is null and isNullInclusive is true, then all jar names in the classloader will match. A pattern is a set of acceptable jar names. Each acceptable jar name is a regex. Each regex can be separated by either a "," or a "|". If you use a "|" this or's together the jar name patterns. This means that ordering of the matches is unimportant to you. If instead, you want to match particular jar names, and you want to match them in order, you should separate the regexs with "," instead. Eg "aaa-.*\\.jar|bbb-.*\\.jar" Will iterate over the jar names in the classloader and match in any order. Eg "aaa-*\\.jar,bbb-.*\\.jar" Will iterate over the jar names in the classloader, matching all those starting with "aaa-" first, then "bbb-". If visitParent is true, then the pattern is applied to the parent loader hierarchy. If false, it is only applied to the classloader passed in.
        Parameters:
        pattern - the pattern to use for jar matching
        loader - the class loader to look for jars in
        isNullInclusive - if true, an empty pattern means all names match, if false, none match
        visitParent - if true, visit parent classloaders too
        Throws:
        java.lang.Exception - if unable to scan
      • matched

        public void matched​(java.net.URI uri)
                     throws java.lang.Exception
        Deprecated.
        Specified by:
        matched in class PatternMatcher
        Throws:
        java.lang.Exception