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