Top Fields Constructors Methods
org.jboss.modules

pack-priv final Class FilteredIterableResourceLoader

extends Object
implements IterableResourceLoader
Class Inheritance
All Implemented Interfaces
org.jboss.modules.IterableResourceLoader, org.jboss.modules.ResourceLoader, java.lang.AutoCloseable
Imports
java.io.IOException, java.net.URI, java.util.Collection, .Iterator, org.jboss.modules.filter.PathFilter, .PathFilters

Field Summary

Modifier and TypeField and Description
private final PathFilter
private final IterableResourceLoader

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
close()

Overrides default org.jboss.modules.ResourceLoader.close.

Closes this resource, relinquishing any underlying resources.
public ClassSpec
getClassSpec(final String
the fileName of the class, e.g. for the class org.jboss.modules.ResourceLoader the fileName will be org/jboss/modules/ResourceLoader.class
fileName
)

Implements org.jboss.modules.ResourceLoader.getClassSpec.

Get the class specification for the given class name.
public String
getLibrary(final String
the name
name
)

Implements org.jboss.modules.ResourceLoader.getLibrary.

Get the absolute physical filesystem path for a library with the given name.
public URI
getLocation()

Overrides default org.jboss.modules.ResourceLoader.getLocation.

Get the base location of the resources in this loader (if any).
public PackageSpec
getPackageSpec(final String
the directory name
name
)

Implements org.jboss.modules.ResourceLoader.getPackageSpec.

Get the package specification for the given directory name.
public Collection<String>
getPaths()

Implements org.jboss.modules.ResourceLoader.getPaths.

Get the collection of resource paths.
public Resource
getResource(final String
the resource name
name
)

Implements org.jboss.modules.ResourceLoader.getResource.

Get a resource with the given name.
public String
getRootName()

Overrides default org.jboss.modules.ResourceLoader.getRootName.

Deprecated
Get the name of the root represented by this resource loader.
public Iterator<Resource>
iterateResources(final String
the path to search under
startPath
,
final boolean
true to recursively descend into subdirectories, false to only read this path
recursive
)

Implements org.jboss.modules.IterableResourceLoader.iterateResources.

Enumerate all the resources under the given path.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

filterback to summary
private final PathFilter filter
loaderback to summary
private final IterableResourceLoader loader

Constructor Detail

FilteredIterableResourceLoaderback to summary
pack-priv FilteredIterableResourceLoader(final PathFilter filter, final IterableResourceLoader loader)

Method Detail

closeback to summary
public void close()

Overrides default org.jboss.modules.ResourceLoader.close.

Doc from org.jboss.modules.ResourceLoader.close.

Closes this resource, relinquishing any underlying resources. This method is invoked automatically on objects managed by the try-with-resources statement.

getClassSpecback to summary
public ClassSpec getClassSpec(final String fileName) throws IOException

Implements org.jboss.modules.ResourceLoader.getClassSpec.

Doc from org.jboss.modules.ResourceLoader.getClassSpec.

Get the class specification for the given class name. If no matching class is found, null is returned.

Parameters
fileName:String

the fileName of the class, e.g. for the class org.jboss.modules.ResourceLoader the fileName will be org/jboss/modules/ResourceLoader.class

Returns:ClassSpec

the class specification, or null if the named class is not found

Exceptions
IOException:
if an I/O error occurs
getLibraryback to summary
public String getLibrary(final String name)

Implements org.jboss.modules.ResourceLoader.getLibrary.

Doc from org.jboss.modules.ResourceLoader.getLibrary.

Get the absolute physical filesystem path for a library with the given name. The resultant path should be path-separated using "/" characters.

Parameters
name:String

the name

Returns:String

the path or null if the library is not present

getLocationback to summary
public URI getLocation()

Overrides default org.jboss.modules.ResourceLoader.getLocation.

Doc from org.jboss.modules.ResourceLoader.getLocation.

Get the base location of the resources in this loader (if any). If the location is not known, or the resource loader does not support locations, or the resource loader does not support this method, null is returned.

Returns:URI

the base location of the resources in this loader, or null if not available

getPackageSpecback to summary
public PackageSpec getPackageSpec(final String name) throws IOException

Implements org.jboss.modules.ResourceLoader.getPackageSpec.

Doc from org.jboss.modules.ResourceLoader.getPackageSpec.

Get the package specification for the given directory name. Always returns a package specification; this method cannot be used to test for the existence of a package. A package spec should always be acquired from the same resource loader which provided the class specification. The directory name will always be specified using "/" separators.

Parameters
name:String

the directory name

Returns:PackageSpec

the package specification

Exceptions
IOException:
if an I/O error occurs
getPathsback to summary
public Collection<String> getPaths()

Implements org.jboss.modules.ResourceLoader.getPaths.

Doc from org.jboss.modules.ResourceLoader.getPaths.

Get the collection of resource paths. Called one time only when the resource loader is initialized. The paths should use "/" characters to separate the path segments.

Returns:Collection<String>

the resource paths

getResourceback to summary
public Resource getResource(final String name)

Implements org.jboss.modules.ResourceLoader.getResource.

Doc from org.jboss.modules.ResourceLoader.getResource.

Get a resource with the given name. If no such resource is available, null is returned. The resource name will always be specified using "/" separators for the directory segments.

Parameters
name:String

the resource name

Returns:Resource

the resource, or null if it is not available

getRootNameback to summary
public String getRootName()

Overrides default org.jboss.modules.ResourceLoader.getRootName.

Doc from org.jboss.modules.ResourceLoader.getRootName.

Deprecated

Get the name of the root represented by this resource loader.

Returns:String

the name of the root

Annotations
@Deprecated
iterateResourcesback to summary
public Iterator<Resource> iterateResources(final String startPath, final boolean recursive)

Implements org.jboss.modules.IterableResourceLoader.iterateResources.

Doc from org.jboss.modules.IterableResourceLoader.iterateResources.

Enumerate all the resources under the given path. The given path name is relative to the root of the resource loader. If the path "escapes" the root via .., such segments will be consumed. If the path is absolute, it will be converted to a relative path by dropping the leading /.

Parameters
startPath:String

the path to search under

recursive:boolean

true to recursively descend into subdirectories, false to only read this path

Returns:Iterator<Resource>

the resource iterator (possibly empty)