StandardJarScanner (Apache Tomcat 7.0.104 API Documentation)

org.apache.tomcat.util.scan

## Class StandardJarScanner

- java.lang.Object
- - org.apache.tomcat.util.scan.StandardJarScanner

- All Implemented Interfaces:
    JarScanner

      public class StandardJarScanner
      extends Object
      implements JarScanner

  The default `JarScanner` implementation scans the WEB-INF/lib directory followed by the provided classloader and then works up the classloader hierarchy. This implementation is sufficient to meet the requirements of the Servlet 3.0 specification as well as to provide a number of Tomcat specific extensions. The extensions are:
  - Scanning the classloader hierarchy (enabled by default)
  - Testing all files to see if they are JARs (disabled by default)
  - Testing all directories to see if they are exploded JARs (disabled by default)
  All of the extensions may be controlled via configuration.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `StandardJarScanner()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `doScanClassPath(ClassLoader classloader, JarScannerCallback callback, Set<String> ignoredJars)`
    `protected List<URL>` | `getClassPath()`
    `boolean` | `isScanAllDirectories()`
    `boolean` | `isScanAllFiles()`
    `boolean` | `isScanBootstrapClassPath()`
    `boolean` | `isScanClassPath()`
    `protected void` | `process(JarScannerCallback callback, URL url)`
    `void` | `scan(ServletContext context, ClassLoader classloader, JarScannerCallback callback, Set<String> jarsToSkip)` Scan the provided ServletContext and classloader for JAR files.
    `void` | `setScanAllDirectories(boolean scanAllDirectories)`
    `void` | `setScanAllFiles(boolean scanAllFiles)`
    `void` | `setScanBootstrapClassPath(boolean scanBootstrapClassPath)`
    `void` | `setScanClassPath(boolean scanClassPath)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### StandardJarScanner

          public StandardJarScanner()

  - ### Method Detail

    - #### isScanClassPath

          public boolean isScanClassPath()

    - #### setScanClassPath

          public void setScanClassPath(boolean scanClassPath)

    - #### isScanAllFiles

          public boolean isScanAllFiles()

    - #### setScanAllFiles

          public void setScanAllFiles(boolean scanAllFiles)

    - #### isScanAllDirectories

          public boolean isScanAllDirectories()

    - #### setScanAllDirectories

          public void setScanAllDirectories(boolean scanAllDirectories)

    - #### isScanBootstrapClassPath

          public boolean isScanBootstrapClassPath()

    - #### setScanBootstrapClassPath

          public void setScanBootstrapClassPath(boolean scanBootstrapClassPath)

    - #### scan

          public void scan(ServletContext context,
                  ClassLoader classloader,
                  JarScannerCallback callback,
                  Set<String> jarsToSkip)

      Scan the provided ServletContext and classloader for JAR files. Each JAR file found will be passed to the callback handler to be processed.
      Specified by:
        `scan` in interface `JarScanner`
      Parameters:
        `context` - The ServletContext - used to locate and access WEB-INF/lib
        `classloader` - The classloader - used to access JARs not in WEB-INF/lib
        `callback` - The handler to process any JARs found
        `jarsToSkip` - List of JARs to ignore. If this list is null, a default list will be read from the system property defined by `Constants.SKIP_JARS_PROPERTY`

    - #### doScanClassPath

          protected void doScanClassPath(ClassLoader classloader,
                             JarScannerCallback callback,
                             Set<String> ignoredJars)

    - #### getClassPath

          protected List<URL> getClassPath()

    - #### process

          protected void process(JarScannerCallback callback,
                     URL url)
                          throws IOException

      Throws:
        `IOException`

Copyright © 2000-2020 Apache Software Foundation. All Rights Reserved.