Top Description Constructors Methods
org.mortbay.jetty.webapp

public abstract Class JarScanner

extends Object
Class Inheritance
Known Direct Subclasses
org.mortbay.jetty.webapp.TagLibConfiguration.TagLibJarScanner
Imports
java.io.InputStream, java.net.URL, .URLClassLoader, java.util.ArrayList, .List, java.util.jar.JarEntry, .JarInputStream, java.util.regex.Pattern, org.mortbay.log.Log, org.mortbay.resource.Resource

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

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public abstract void
processEntry(URL jarUrl, JarEntry entry)

public void
public void
processJars(Pattern pattern, URL[] urls, boolean isNullInclusive)

public void
scan(Pattern pattern, ClassLoader loader, boolean isNullInclusive, boolean visitParent)

Find jar names from the classloader matching a pattern.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

JarScannerback to summary
public JarScanner()

Method Detail

processEntryback to summary
public abstract void processEntry(URL jarUrl, JarEntry entry)
processJarback to summary
public void processJar(URL url) throws Exception
processJarsback to summary
public void processJars(Pattern pattern, URL[] urls, boolean isNullInclusive) throws Exception
scanback to summary
public void scan(Pattern pattern, ClassLoader loader, boolean isNullInclusive, boolean visitParent) throws Exception

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.