Package thredds.util.filesource
Class ChainedFileSource
- java.lang.Object
-
- thredds.util.filesource.ChainedFileSource
-
- All Implemented Interfaces:
FileSource
public class ChainedFileSource extends Object implements FileSource
Implements the FileSource interface using a chain of DescendantFileSource objects. This allows a relative path to be given and located in the first DescendantFileSource that contains a matching File.- Since:
- 4.0
-
-
Constructor Summary
Constructors Constructor Description ChainedFileSource(List<DescendantFileSource> chain)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FilegetFile(String path)This implementation requires a relative path.StringtoString()
-
-
-
Constructor Detail
-
ChainedFileSource
public ChainedFileSource(List<DescendantFileSource> chain)
-
-
Method Detail
-
getFile
public File getFile(String path)
This implementation requires a relative path. The relative path may not start with "../" or once "normalized" start with "../". Here "normalized" means that "./" and "path/.." segments are removed, e.g., "dir1/../../dir2" once normalized would be "../dir2".- Specified by:
getFilein interfaceFileSource- Parameters:
path- the relative path to the desired File.- Returns:
- the File represented by the given relative path or null if the path is null or the File it represents does not exist.
-
-