public class FileSystemResourceLocator extends Object implements ResourceLocator
ResourceLocator for a file system.| Constructor and Description |
|---|
FileSystemResourceLocator(File root)
Initiate.
|
| Modifier and Type | Method and Description |
|---|---|
URL |
getResource(String resourcePath)
Obtains the
URL for the resource. |
InputStream |
getResourceAsStream(String resourcePath)
Obtains the
InputStream to the contents of the resource. |
Set<String> |
getResourceChildren(String resourcePath)
Obtains the direct children for the resource.
|
public FileSystemResourceLocator(File root)
root - Root of file system for which all paths are relative.public URL getResource(String resourcePath) throws MalformedURLException
ResourceLocatorURL for the resource.getResource in interface ResourceLocatorresourcePath - Path to the resource.URL to the resource or null if no resource
at path.MalformedURLException - If resource path is malformed.public InputStream getResourceAsStream(String resourcePath)
ResourceLocatorInputStream to the contents of the resource.getResourceAsStream in interface ResourceLocatorresourcePath - Path to the resource.InputStream to the contents of the resource or
null if no resource at path.public Set<String> getResourceChildren(String resourcePath)
ResourceLocatorgetResourceChildren in interface ResourceLocatorresourcePath - Path to the resource.Copyright © 2005–2015. All rights reserved.