public class FileLocator extends Object implements ResourceLocator
file:// prefix i.e. treats paths as literal files
Derived implementations can override the resolve(String) method to
apply some interpretation of the location to resolve special paths, variable
references etc.
| Modifier and Type | Field and Description |
|---|---|
static String |
FILE_URI_PREFIX |
| Constructor and Description |
|---|
FileLocator() |
| Modifier and Type | Method and Description |
|---|---|
InputStream |
open(String searchLocation,
String resourceName)
Opens a search location, potentially applying some resolution rules to
that location
|
protected String |
resolve(String searchLocation)
Resolves the search location
|
public static final String FILE_URI_PREFIX
protected String resolve(String searchLocation)
searchLocation - Search locationpublic InputStream open(String searchLocation, String resourceName) throws IOException
ResourceLocator
If the given resourceName exists in the search location then that
resource should be returned. If that is not a valid resource but the
search location itself is a valid resource then the locator should return
that instead.
open in interface ResourceLocatorsearchLocation - Search locationresourceName - Resource name expected in the search locationnull if not a
valid locationIOException - Thrown if there is a problem accessing the search locationCopyright © 2012–2022. All rights reserved.