Module com.github.rvesse.airline
Class FileLocator
java.lang.Object
com.github.rvesse.airline.parser.resources.FileLocator
- All Implemented Interfaces:
ResourceLocator
- Direct Known Subclasses:
AbstractPlaceholderLocator
,HomeDirectoryLocator
,WorkingDirectoryLocator
A resource locator that does no resolution other than removing any leading
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.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
FILE_URI_PREFIX
- See Also:
-
-
Constructor Details
-
FileLocator
public FileLocator()
-
-
Method Details
-
resolve
Resolves the search location- Parameters:
searchLocation
- Search location- Returns:
- Resolved location
-
open
Description copied from interface:ResourceLocator
Opens a search location, potentially applying some resolution rules to that locationIf 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.- Specified by:
open
in interfaceResourceLocator
- Parameters:
searchLocation
- Search locationresourceName
- Resource name expected in the search location- Returns:
- Input stream to read the search location or
null
if not a valid location - Throws:
IOException
- Thrown if there is a problem accessing the search location
-