Package thredds.util.filesource
Class BasicWithExclusionsDescendantFileSource
java.lang.Object
thredds.util.filesource.BasicWithExclusionsDescendantFileSource
- All Implemented Interfaces:
DescendantFileSource,FileSource
_more_
- Since:
- 4.0
-
Constructor Summary
ConstructorsConstructorDescriptionBasicWithExclusionsDescendantFileSource(File rootDirectory, List<String> exclusions) BasicWithExclusionsDescendantFileSource(String rootDirectoryPath, List<String> exclusions) -
Method Summary
Modifier and TypeMethodDescriptiongetDescendant(String relativePath) Return a DescendantFileSource representing the descendant directory specified by the relative path.Return the File, if it exists, that the given path represents for the FileSource implementation in use.getRelativePath(File file) Return the path relative to the root directory that represents the given descendant file.getRelativePath(String filePath) Return the path relative to the root directory that represents the given descendant file path.Return the root directory represented by this FileLocator as a java.io.File.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.toString()
-
Constructor Details
-
BasicWithExclusionsDescendantFileSource
-
BasicWithExclusionsDescendantFileSource
-
-
Method Details
-
getFile
Description copied from interface:FileSourceReturn the File, if it exists, that the given path represents for the FileSource implementation in use. Different implementations of FileSource can have different restrictions on the set of recognized paths. For instance, some implementations may only be able to handle paths that reference Files under a particular root directory.- Specified by:
getFilein interfaceFileSource- Parameters:
path- the path to the desired File.- Returns:
- the File represented by the path or null.
-
getDescendant
Description copied from interface:DescendantFileSourceReturn a DescendantFileSource representing the descendant directory specified by the relative path.- Specified by:
getDescendantin interfaceDescendantFileSource- 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
Description copied from interface:DescendantFileSourceReturn the root directory represented by this FileLocator as a java.io.File.- Specified by:
getRootDirectoryin interfaceDescendantFileSource- Returns:
- the root directory represented by this FileLocator.
-
getRootDirectoryPath
Description copied from interface:DescendantFileSourceReturn the path of the root directory represented by this FileLocator.- Specified by:
getRootDirectoryPathin interfaceDescendantFileSource- Returns:
- the path of the root directory represented by this FileLocator.
-
isDescendant
Description copied from interface:DescendantFileSourceReturn true if the given File is an existing descendant of the root directory, false otherwise.- Specified by:
isDescendantin interfaceDescendantFileSource- 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
Description copied from interface:DescendantFileSourceReturn true if the given file path is an existing descendant of the root directory, false otherwise.- Specified by:
isDescendantin interfaceDescendantFileSource- 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
Description copied from interface:DescendantFileSourceReturn the path relative to the root directory that represents the given descendant file.- Specified by:
getRelativePathin interfaceDescendantFileSource- 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
Description copied from interface:DescendantFileSourceReturn the path relative to the root directory that represents the given descendant file path.- Specified by:
getRelativePathin interfaceDescendantFileSource- 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.
-
toString
-