public class FileSystemRegistry extends Object implements ResourceRegistry
ResourceRegistry
that consults the file system for resources.Constructor and Description |
---|
FileSystemRegistry(File folder)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
URL |
getResource(String pathname)
Gets a resource
URL corresponding to the given pathname. |
InputStream |
getResourceAsStream(String pathname)
Gets an
InputStream to the resource at the given pathname. |
Enumeration<URL> |
getResources(String pathname)
Gets all resource
URL s corresponding to the given pathname. |
String |
toString()
Creates a human-readable representation of this registry.
|
public FileSystemRegistry(File folder)
public URL getResource(String pathname)
ResourceRegistry
URL
corresponding to the given pathname.getResource
in interface ResourceRegistry
pathname
- the resource pathname.URL
or null
if not found.public Enumeration<URL> getResources(String pathname)
ResourceRegistry
URL
s corresponding to the given pathname.getResources
in interface ResourceRegistry
pathname
- the resource pathname.Enumeration
of resource URL
s.public InputStream getResourceAsStream(String pathname)
ResourceRegistry
InputStream
to the resource at the given pathname.getResourceAsStream
in interface ResourceRegistry
pathname
- the resource pathname.InputStream
to the resource or null
if not found.