com.faunos.util.boot
Class AbstractFileResolver
java.lang.Object
com.faunos.util.boot.FileResolver
com.faunos.util.boot.AbstractFileResolver
- Direct Known Subclasses:
- DirectoryBasedFileResolver
public abstract class AbstractFileResolver
- extends FileResolver
Centralizes the code necessary to check whether a candidate filepath
meets the Constraints
argument of the resolve
method.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractFileResolver
public AbstractFileResolver()
resolve
public File resolve(String path,
FileResolver.Constraints arg)
- Resolves the specified filepath by invoking the
filterConstraints
method on the a candidate file
returned by the getCandidate
method.
- Specified by:
resolve
in class FileResolver
- See Also:
filterConstraints(File, com.faunos.util.boot.FileResolver.Constraints)
,
getCandidate(String)
filterConstraints
protected final File filterConstraints(File file,
FileResolver.Constraints arg)
- Filters the given file for the specified constraints. If the
file does not meet the constraints
null
is
returned; o.w. the file is returned unchanged.
getCandidate
protected abstract File getCandidate(String path)
- Returns a candidate path, or
null
if one cannot be
constructed.