public class PathResourceFinder extends LazyMultiResourceFinder
ResourceFinder
that finds its resources along a "path"
consisting of JAR file names, ZIP file names, and directory names.ZipFileResourceFinder
,
DirectoryResourceFinder
EMPTY_RESOURCE_FINDER
Constructor and Description |
---|
PathResourceFinder(java.io.File[] entries) |
PathResourceFinder(java.util.Iterator<ResourceFinder> entries) |
PathResourceFinder(java.lang.String path) |
Modifier and Type | Method and Description |
---|---|
private static java.util.Iterator<ResourceFinder> |
createIterator(java.util.Iterator<java.io.File> entries) |
private static ResourceFinder |
createResourceFinder(java.io.File entry)
A factory method that creates a Java classpath-style ResourceFinder as
follows:
entry Returned ResourceFinder
"*.jar" fileZipFileResourceFinder
"*.zip" fileZipFileResourceFinder
directoryDirectoryResourceFinder
any otherA ResourceFinder that never finds a resource
|
static java.io.File[] |
parsePath(java.lang.String s)
Break a given string up by the system-dependent path-separator character (on UNIX systems,
this character is ':'; on Microsoft Windows systems it is ';').
|
findResource
findResourceAsStream
public PathResourceFinder(java.io.File[] entries)
entries
- The entries of the "path"public PathResourceFinder(java.util.Iterator<ResourceFinder> entries)
entries
- The entries of the "path" (type must be File
)public PathResourceFinder(java.lang.String path)
path
- A java-like path, i.e. a "path separator"-separated list of entries.private static java.util.Iterator<ResourceFinder> createIterator(java.util.Iterator<java.io.File> entries)
public static java.io.File[] parsePath(java.lang.String s)
UNIX Examples:
File.pathSeparatorChar
private static ResourceFinder createResourceFinder(java.io.File entry)
entry | Returned ResourceFinder |
---|---|
"*.jar" file | ZipFileResourceFinder |
"*.zip" file | ZipFileResourceFinder |
directory | DirectoryResourceFinder |
any other | A ResourceFinder that never finds a resource |
ResourceFinder