Package org.apache.struts2.util.finder
Class UrlSet
java.lang.Object
org.apache.struts2.util.finder.UrlSet
Use with ClassFinder to filter the Urls to be scanned, example:
 UrlSet urlSet = new UrlSet(classLoader);
 urlSet = urlSet.exclude(ClassLoader.getSystemClassLoader().getParent());
 urlSet = urlSet.excludeJavaExtDirs();
 urlSet = urlSet.excludeJavaEndorsedDirs();
 urlSet = urlSet.excludeJavaHome();
 urlSet = urlSet.excludePaths(System.getProperty("sun.boot.class.path", ""));
 urlSet = urlSet.exclude(".*?/JavaVM.framework/.*");
 urlSet = urlSet.exclude(".*?/activemq-(core|ra)-[\\d.]+.jar(!/)?");
 - Author:
- David Blevins
- 
Nested Class SummaryNested Classes
- 
Constructor SummaryConstructorsConstructorDescriptionUrlSet(Collection<URL> urls) Ignores all URLs that are not "jar" or "file"UrlSet(ClassLoaderInterface classLoader) UrlSet(ClassLoaderInterface classLoader, Set<String> protocols) 
- 
Method SummaryModifier and TypeMethodDescriptionexclude(ClassLoaderInterface parent) Calls excludePaths(System.getProperty("java.endorsed.dirs"))Calls excludePaths(System.getProperty("java.ext.dirs"))excludePaths(String pathString) Calls excludePaths(System.getProperty("java.ext.dirs"))getUrls()includeClassesUrl(ClassLoaderInterface classLoaderInterface, UrlSet.FileProtocolNormalizer normalizer) Try to find a classes directory inside a war file add its normalized url to this set
- 
Constructor Details- 
UrlSet- Throws:
- IOException
 
- 
UrlSet- Throws:
- IOException
 
- 
UrlSet
- 
UrlSetIgnores all URLs that are not "jar" or "file"- Parameters:
- urls- collection of URLs
 
 
- 
- 
Method Details- 
include
- 
exclude
- 
exclude- Throws:
- IOException
 
- 
exclude- Throws:
- MalformedURLException
 
- 
exclude- Throws:
- MalformedURLException
 
- 
excludeJavaExtDirsCalls excludePaths(System.getProperty("java.ext.dirs"))- Returns:
- url set
- Throws:
- MalformedURLException- in case if incorrect URL
 
- 
excludeJavaEndorsedDirsCalls excludePaths(System.getProperty("java.endorsed.dirs"))- Returns:
- url set
- Throws:
- MalformedURLException- in case if incorrect URL
 
- 
excludeUserExtensionsDirCalls excludePaths(System.getProperty("java.ext.dirs"))- Returns:
- url set
- Throws:
- MalformedURLException- in case if incorrect URL
 
- 
excludeJavaHome- Throws:
- MalformedURLException
 
- 
excludePaths- Throws:
- MalformedURLException
 
- 
matching
- 
includeClassesUrlpublic UrlSet includeClassesUrl(ClassLoaderInterface classLoaderInterface, UrlSet.FileProtocolNormalizer normalizer) throws IOException Try to find a classes directory inside a war file add its normalized url to this set- Parameters:
- classLoaderInterface- class loader interface
- normalizer- file protocol normalizer
- Returns:
- url set
- Throws:
- IOException- in case of IO errors
 
- 
relative- Throws:
- MalformedURLException
 
- 
getUrls
 
-