Web Site

org.codehaus.janino.util.resource
Class ResourceFinder

java.lang.Object
  extended byorg.codehaus.janino.util.resource.ResourceFinder
Direct Known Subclasses:
FileResourceFinder, MultiResourceFinder, ZipFileResourceFinder

public abstract class ResourceFinder
extends Object

Finds a resource by name.


Nested Class Summary
static class ResourceFinder.FileResource
          Representation of a resource that is a File.
static interface ResourceFinder.Resource
          Representation of a resource than was found by a ResourceFinder.
 
Constructor Summary
ResourceFinder()
           
 
Method Summary
abstract  ResourceFinder.Resource findResource(String resourceName)
          Find a resource by name and return it as a ResourceFinder.Resource object.
 InputStream findResourceAsStream(String resourceName)
          Find a resource by name and open it for reading
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceFinder

public ResourceFinder()
Method Detail

findResourceAsStream

public final InputStream findResourceAsStream(String resourceName)
                                       throws IOException
Find a resource by name and open it for reading

Parameters:
resourceName - Slash-separated name that identifies the resource
Returns:
null if the resource could not be found
Throws:
IOException

findResource

public abstract ResourceFinder.Resource findResource(String resourceName)
Find a resource by name and return it as a ResourceFinder.Resource object.

Parameters:
resourceName - Slash-separated name that identifies the resource
Returns:
null if the resource could not be found

Web Site