final class FilteredIterableResourceLoader extends java.lang.Object implements IterableResourceLoader
| Modifier and Type | Field and Description |
|---|---|
private PathFilter |
filter |
private IterableResourceLoader |
loader |
| Constructor and Description |
|---|
FilteredIterableResourceLoader(PathFilter filter,
IterableResourceLoader loader) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes this resource, relinquishing any underlying resources.
|
ClassSpec |
getClassSpec(java.lang.String fileName)
Get the class specification for the given class name.
|
java.lang.String |
getLibrary(java.lang.String name)
Get the absolute physical filesystem path for a library with the given name.
|
java.net.URI |
getLocation()
Get the base location of the resources in this loader (if any).
|
PackageSpec |
getPackageSpec(java.lang.String name)
Get the package specification for the given directory name.
|
java.util.Collection<java.lang.String> |
getPaths()
Get the collection of resource paths.
|
Resource |
getResource(java.lang.String name)
Get a resource with the given name.
|
java.lang.String |
getRootName()
Get the name of the root represented by this resource loader.
|
java.util.Iterator<Resource> |
iterateResources(java.lang.String startPath,
boolean recursive)
Enumerate all the resources under the given path.
|
private final PathFilter filter
private final IterableResourceLoader loader
FilteredIterableResourceLoader(PathFilter filter, IterableResourceLoader loader)
public java.lang.String getRootName()
ResourceLoadergetRootName in interface ResourceLoaderpublic ClassSpec getClassSpec(java.lang.String fileName) throws java.io.IOException
ResourceLoadernull is returned.getClassSpec in interface ResourceLoaderfileName - the fileName of the class, e.g. for the class org.jboss.modules.ResourceLoader
the fileName will be org/jboss/modules/ResourceLoader.classnull if the named class is not foundjava.io.IOException - if an I/O error occurspublic PackageSpec getPackageSpec(java.lang.String name) throws java.io.IOException
ResourceLoader/" separators.getPackageSpec in interface ResourceLoadername - the directory namejava.io.IOException - if an I/O error occurspublic Resource getResource(java.lang.String name)
ResourceLoadernull is returned.
The resource name will always be specified using "/" separators for the directory segments.getResource in interface ResourceLoadername - the resource namenull if it is not availablepublic java.lang.String getLibrary(java.lang.String name)
ResourceLoader/" characters.getLibrary in interface ResourceLoadername - the namenull if the library is not presentpublic java.util.Collection<java.lang.String> getPaths()
ResourceLoader/" characters to separate the path segments.getPaths in interface ResourceLoaderpublic java.util.Iterator<Resource> iterateResources(java.lang.String startPath, boolean recursive)
IterableResourceLoader.., such segments will be consumed.
If the path is absolute, it will be converted to a relative path by dropping the leading /.iterateResources in interface IterableResourceLoaderstartPath - the path to search underrecursive - true to recursively descend into subdirectories, false to only read this pathpublic void close()
ResourceLoadertry-with-resources statement.close in interface java.lang.AutoCloseableclose in interface ResourceLoaderpublic java.net.URI getLocation()
ResourceLoadernull is returned.getLocation in interface ResourceLoadernull if not available