public class BasicDescendantFileSource extends java.lang.Object implements DescendantFileSource
| Constructor and Description |
|---|
BasicDescendantFileSource(java.io.File rootDirectory) |
BasicDescendantFileSource(java.lang.String rootDirectoryPath) |
| Modifier and Type | Method and Description |
|---|---|
DescendantFileSource |
getDescendant(java.lang.String relativePath)
Return a DescendantFileSource representing the descendant directory
specified by the relative path.
|
java.io.File |
getFile(java.lang.String path)
This implementation requires the path to be relative to the root
directory and a descendant of the root directory.
|
java.lang.String |
getRelativePath(java.io.File file)
Return the path relative to the root directory that represents the given descendant file.
|
java.lang.String |
getRelativePath(java.lang.String filePath)
Return the path relative to the root directory that represents the given descendant file path.
|
java.io.File |
getRootDirectory()
Return the root directory represented by this FileLocator as a java.io.File.
|
java.lang.String |
getRootDirectoryPath()
Return the path of the root directory represented by this FileLocator.
|
boolean |
isDescendant(java.io.File file)
Return true if the given File is an existing descendant of the root directory, false otherwise.
|
boolean |
isDescendant(java.lang.String filePath)
Return true if the given file path is an existing descendant of the root directory, false otherwise.
|
java.lang.String |
toString() |
public BasicDescendantFileSource(java.io.File rootDirectory)
public BasicDescendantFileSource(java.lang.String rootDirectoryPath)
public java.io.File getFile(java.lang.String path)
getFile in interface FileSourcepath - the relative path to the descendant File.public DescendantFileSource getDescendant(java.lang.String relativePath)
DescendantFileSourcegetDescendant in interface DescendantFileSourcerelativePath - the relative path to the descendant directory.public java.io.File getRootDirectory()
DescendantFileSourcegetRootDirectory in interface DescendantFileSourcepublic java.lang.String getRootDirectoryPath()
DescendantFileSourcegetRootDirectoryPath in interface DescendantFileSourcepublic boolean isDescendant(java.io.File file)
DescendantFileSourceisDescendant in interface DescendantFileSourcefile - the File to be checked if it is a descendant.public boolean isDescendant(java.lang.String filePath)
DescendantFileSourceisDescendant in interface DescendantFileSourcefilePath - the file path to be checked if it is a descendant.public java.lang.String getRelativePath(java.io.File file)
DescendantFileSourcegetRelativePath in interface DescendantFileSourcefile - the File for which the relative path is to be determined.public java.lang.String getRelativePath(java.lang.String filePath)
DescendantFileSourcegetRelativePath in interface DescendantFileSourcefilePath - the file path for which the relative path is to be determined.public java.lang.String toString()
toString in class java.lang.Object