com.faunos.util.boot
Class AbstractFileResolver

java.lang.Object
  extended by com.faunos.util.boot.FileResolver
      extended by 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.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.faunos.util.boot.FileResolver
FileResolver.Constraints
 
Constructor Summary
AbstractFileResolver()
           
 
Method Summary
protected  File filterConstraints(File file, FileResolver.Constraints arg)
          Filters the given file for the specified constraints.
protected abstract  File getCandidate(String path)
          Returns a candidate path, or null if one cannot be constructed.
 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.
 
Methods inherited from class com.faunos.util.boot.FileResolver
resolveDirectory, resolveExistingDirectory, resolveExistingFile, resolveFile
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractFileResolver

public AbstractFileResolver()
Method Detail

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.



SourceForge.net Logo