Top Description Fields Constructors Methods
org.codehaus.commons.compiler.util.resource

public abstract Class ResourceFinder

extends Object
Class Inheritance
Known Direct Subclasses
org.codehaus.commons.compiler.util.resource.ZipFileResourceFinder, org.codehaus.commons.compiler.util.resource.ListableResourceFinder
Imports
java.io.IOException, .InputStream, java.util.Collections, org.codehaus.commons.nullanalysis.Nullable

Finds a resource by name.

Notice that there is a symmetrical concept org.codehaus.commons.compiler.util.resource.ResourceCreator that creates resources for writing.

See Also
findResource(String), findResourceAsStream(String), org.codehaus.commons.compiler.util.resource.ResourceCreator

Field Summary

Modifier and TypeField and Description
public static final ListableResourceFinder
EMPTY_RESOURCE_FINDER

This one's useful when a resource finder is required, but cannot be created for some reason.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public abstract Resource

Returns:

null if the resource could not be found
findResource
(String
Designates the resource; typically structured by slashes ("/") like "com/foo/pkg/Bar.class"
resourceName
)

Finds a resource by name and return it as a Resource object.

public final InputStream

Returns:

null if the resource could not be found
findResourceAsStream
(String
Designates the resource; typically structured by slashes ("/") like "com/foo/pkg/Bar.class"
resourceName
)

Finds a resource by name and open it for reading.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

EMPTY_RESOURCE_FINDERback to summary
public static final ListableResourceFinder EMPTY_RESOURCE_FINDER

This one's useful when a resource finder is required, but cannot be created for some reason.

Constructor Detail

ResourceFinderback to summary
public ResourceFinder()

Method Detail

findResourceback to summary
public abstract Resource findResource(String resourceName)

Finds a resource by name and return it as a Resource object.

Parameters
resourceName:String

Designates the resource; typically structured by slashes ("/") like "com/foo/pkg/Bar.class"

Returns:Resource

null if the resource could not be found

Annotations
@Nullable
findResourceAsStreamback to summary
public final InputStream findResourceAsStream(String resourceName) throws IOException

Finds a resource by name and open it for reading.

Parameters
resourceName:String

Designates the resource; typically structured by slashes ("/") like "com/foo/pkg/Bar.class"

Returns:InputStream

null if the resource could not be found

Annotations
@Nullable
Exceptions
IOException:
The resource was found, but there are problems opening it