Class MultiResourceFinder
- java.lang.Object
-
- org.codehaus.commons.compiler.util.resource.ResourceFinder
-
- org.codehaus.commons.compiler.util.resource.ListableResourceFinder
-
- org.codehaus.commons.compiler.util.resource.MultiResourceFinder
-
- Direct Known Subclasses:
LazyMultiResourceFinder
public class MultiResourceFinder extends ListableResourceFinder
AResourceFinderthat finds its resources through a collection of otherResourceFinders.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Iterable<? extends ResourceFinder>resourceFinders-
Fields inherited from class org.codehaus.commons.compiler.util.resource.ResourceFinder
EMPTY_RESOURCE_FINDER
-
-
Constructor Summary
Constructors Constructor Description MultiResourceFinder(java.lang.Iterable<? extends ResourceFinder> resourceFinders)MultiResourceFinder(ResourceFinder... resourceFinders)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ResourcefindResource(java.lang.String resourceName)Finds a resource by name and return it as aResourceobject.java.lang.Iterable<Resource>list(java.lang.String resourceNamePrefix, boolean recurse)-
Methods inherited from class org.codehaus.commons.compiler.util.resource.ResourceFinder
findResourceAsStream
-
-
-
-
Field Detail
-
resourceFinders
private final java.lang.Iterable<? extends ResourceFinder> resourceFinders
-
-
Constructor Detail
-
MultiResourceFinder
public MultiResourceFinder(java.lang.Iterable<? extends ResourceFinder> resourceFinders)
- Parameters:
resourceFinders- The entries of the "path"
-
MultiResourceFinder
public MultiResourceFinder(ResourceFinder... resourceFinders)
- Parameters:
resourceFinders- The entries of the "path"
-
-
Method Detail
-
findResource
@Nullable public final Resource findResource(java.lang.String resourceName)
Description copied from class:ResourceFinderFinds a resource by name and return it as aResourceobject.- Specified by:
findResourcein classResourceFinder- Parameters:
resourceName- Designates the resource; typically structured by slashes ("/") like "com/foo/pkg/Bar.class"- Returns:
nullif the resource could not be found
-
list
@Nullable public java.lang.Iterable<Resource> list(java.lang.String resourceNamePrefix, boolean recurse) throws java.io.IOException
- Specified by:
listin classListableResourceFinder- Parameters:
resourceNamePrefix- E.g.""or"java/lang"- Returns:
- All resources who's name starts with the given prefix;
nulliff a location designated by the resourceNamePrefix does not exist - Throws:
java.io.IOException
-
-