Class StandardJarScanFilter
java.lang.Object
org.apache.tomcat.util.scan.StandardJarScanFilter
- All Implemented Interfaces:
JarScanFilter
Standard implementation of JarScanFilter that provides configuration for JAR scanning filters.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancheck(JarScanType jarScanType, String jarName) Check if a JAR should be included in the scan results.Returns the pluggability scan pattern.Returns the pluggability skip pattern.Returns the TLD scan pattern.Returns the TLD skip pattern.booleanReturns whether default pluggability scanning is enabled.booleanReturns whether default TLD scanning is enabled.booleanDetermine if all JAR scans should be skipped.voidsetDefaultPluggabilityScan(boolean defaultPluggabilityScan) Sets whether default pluggability scanning is enabled.voidsetDefaultTldScan(boolean defaultTldScan) Sets whether default TLD scanning is enabled.voidsetPluggabilityScan(String pluggabilityScan) Sets the pluggability scan pattern.voidsetPluggabilitySkip(String pluggabilitySkip) Sets the pluggability skip pattern.voidsetTldScan(String tldScan) Sets the TLD scan pattern.voidsetTldSkip(String tldSkip) Sets the TLD skip pattern.
-
Constructor Details
-
StandardJarScanFilter
public StandardJarScanFilter()This is the standard implementation ofJarScanFilter. By default, the following filtering rules are used:- JARs that match neither the skip nor the scan list will be included in scan results.
- JARs that match the skip list but not the scan list will be excluded from scan results.
- JARs that match the scan list will be included from scan results.
Constants.SKIP_JARS_PROPERTYandConstants.SCAN_JARS_PROPERTYrespectively. These default values may be over-ridden for theJarScanType.TLDandJarScanType.PLUGGABILITYscans. The filtering rules may also be modified for these scan types usingsetDefaultTldScan(boolean)andsetDefaultPluggabilityScan(boolean). If set tofalse, the following filtering rules are used for associated type:- JARs that match neither the skip nor the scan list will be excluded from scan results.
- JARs that match the scan list but not the skip list will be included in scan results.
- JARs that match the skip list will be excluded from scan results.
-
-
Method Details
-
getTldSkip
-
setTldSkip
Sets the TLD skip pattern.- Parameters:
tldSkip- the TLD skip pattern
-
getTldScan
-
setTldScan
Sets the TLD scan pattern.- Parameters:
tldScan- the TLD scan pattern
-
isSkipAll
public boolean isSkipAll()Description copied from interface:JarScanFilterDetermine if all JAR scans should be skipped.- Specified by:
isSkipAllin interfaceJarScanFilter- Returns:
trueif all of the scans should be skipped which can improve startup performance. The default isfalse.
-
isDefaultTldScan
public boolean isDefaultTldScan()Returns whether default TLD scanning is enabled.- Returns:
- true if default TLD scanning is enabled
-
setDefaultTldScan
public void setDefaultTldScan(boolean defaultTldScan) Sets whether default TLD scanning is enabled.- Parameters:
defaultTldScan- true to enable default TLD scanning
-
getPluggabilitySkip
Returns the pluggability skip pattern.- Returns:
- the pluggability skip pattern
-
setPluggabilitySkip
Sets the pluggability skip pattern.- Parameters:
pluggabilitySkip- the pluggability skip pattern
-
getPluggabilityScan
Returns the pluggability scan pattern.- Returns:
- the pluggability scan pattern
-
setPluggabilityScan
Sets the pluggability scan pattern.- Parameters:
pluggabilityScan- the pluggability scan pattern
-
isDefaultPluggabilityScan
public boolean isDefaultPluggabilityScan()Returns whether default pluggability scanning is enabled.- Returns:
- true if default pluggability scanning is enabled
-
setDefaultPluggabilityScan
public void setDefaultPluggabilityScan(boolean defaultPluggabilityScan) Sets whether default pluggability scanning is enabled.- Parameters:
defaultPluggabilityScan- true to enable default pluggability scanning
-
check
Description copied from interface:JarScanFilterCheck if a JAR should be included in the scan results.- Specified by:
checkin interfaceJarScanFilter- Parameters:
jarScanType- The type of JAR scan currently being performedjarName- The name of the JAR file (without any path information) to be checked to see if it should be included in the results or not- Returns:
trueif the JAR should be returned in the results,falseif it should be excluded
-