Package thredds.util.filesource
Interface DescendantFileSource
-
- All Superinterfaces:
FileSource
- All Known Implementing Classes:
BasicDescendantFileSource,BasicWithExclusionsDescendantFileSource
public interface DescendantFileSource extends FileSource
Represent a root directory and act as a source for existing java.io.File descendants of the root directory. NOTE: Perhaps should instead be using org.springframework.core.io.Resource.- Since:
- 4.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description DescendantFileSourcegetDescendant(String relativePath)Return a DescendantFileSource representing the descendant directory specified by the relative path.StringgetRelativePath(File file)Return the path relative to the root directory that represents the given descendant file.StringgetRelativePath(String filePath)Return the path relative to the root directory that represents the given descendant file path.FilegetRootDirectory()Return the root directory represented by this FileLocator as a java.io.File.StringgetRootDirectoryPath()Return the path of the root directory represented by this FileLocator.booleanisDescendant(File file)Return true if the given File is an existing descendant of the root directory, false otherwise.booleanisDescendant(String filePath)Return true if the given file path is an existing descendant of the root directory, false otherwise.-
Methods inherited from interface thredds.util.filesource.FileSource
getFile
-
-
-
-
Method Detail
-
getDescendant
DescendantFileSource getDescendant(String relativePath)
Return a DescendantFileSource representing the descendant directory specified by the relative path.- Parameters:
relativePath- the relative path to the descendant directory.- Returns:
- a FileLocator representing the descendant root directory or null if the path is null or the descendant directory doesn't exist or isn't a directory (or isn't a descendant).
-
getRootDirectory
File getRootDirectory()
Return the root directory represented by this FileLocator as a java.io.File.- Returns:
- the root directory represented by this FileLocator.
-
getRootDirectoryPath
String getRootDirectoryPath()
Return the path of the root directory represented by this FileLocator.- Returns:
- the path of the root directory represented by this FileLocator.
-
isDescendant
boolean isDescendant(File file)
Return true if the given File is an existing descendant of the root directory, false otherwise.- Parameters:
file- the File to be checked if it is a descendant.- Returns:
- true if the given file is an existing descendant, false otherwise.
-
isDescendant
boolean isDescendant(String filePath)
Return true if the given file path is an existing descendant of the root directory, false otherwise.- Parameters:
filePath- the file path to be checked if it is a descendant.- Returns:
- true if the given file path represents an existing descendant, false otherwise.
-
getRelativePath
String getRelativePath(File file)
Return the path relative to the root directory that represents the given descendant file.- Parameters:
file- the File for which the relative path is to be determined.- Returns:
- the path relative to the root directory that represents the given descendant file or null if the given file is null or not a descendant.
-
getRelativePath
String getRelativePath(String filePath)
Return the path relative to the root directory that represents the given descendant file path.- Parameters:
filePath- the file path for which the relative path is to be determined.- Returns:
- the path relative to the root directory that represents the given descendant file path or null if the given file path is null or not a descendant.
-
-