Class ResourceFinder
java.lang.Object
org.codehaus.commons.compiler.util.resource.ResourceFinder
- Direct Known Subclasses:
ListableResourceFinder, ZipFileResourceFinder
Finds a resource by name.
Notice that there is a symmetrical concept ResourceCreator
that creates resources for writing.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ListableResourceFinderThis one's useful when a resource finder is required, but cannot be created for some reason. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract ResourcefindResource(String resourceName) Finds a resource by name and return it as aResourceobject.final InputStreamfindResourceAsStream(String resourceName) Finds a resource by name and open it for reading.
-
Field Details
-
EMPTY_RESOURCE_FINDER
This one's useful when a resource finder is required, but cannot be created for some reason.
-
-
Constructor Details
-
ResourceFinder
public ResourceFinder()
-
-
Method Details
-
findResourceAsStream
Finds a resource by name and open it for reading.- Parameters:
resourceName- Designates the resource; typically structured by slashes ("/") like "com/foo/pkg/Bar.class"- Returns:
nullif the resource could not be found- Throws:
IOException- The resource was found, but there are problems opening it
-
findResource
-