Class FilesProviderWithDirectory
- Direct Known Subclasses:
FilesProviderWithDirectoryString,FilesProviderWithDirectoryUnary,SingleFile
Base class for implementations of
FilesProvider which do have an associated
directory.- Author:
- Owen Feehan
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreate(InputManagerParameters parameters) Creates or provides a list of files.abstract PathgetDirectoryAsPath(InputContextParameters inputContext) The associated directory with the list of files.getDirectoryAsPathEnsureAbsolute(InputContextParameters inputContext) LikegetDirectoryAsPath(org.anchoranalysis.io.input.InputContextParameters)but converts any relative path to absolute one.matchingFilesForDirectory(Path directory, InputManagerParameters parameters) The matching files for this provider that exist in a particular directory.rootDirectory(InputContextParameters inputContext) A root directory for these files, if it exists.Methods inherited from class org.anchoranalysis.bean.AnchorBean
checkMisconfigured, describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString
-
Constructor Details
-
FilesProviderWithDirectory
public FilesProviderWithDirectory()
-
-
Method Details
-
create
Description copied from class:FilesProviderCreates or provides a list of files.- Specified by:
createin classFilesProvider- Parameters:
parameters- parameters influencing how input-files are obtained.- Returns:
- the list of files from the provider
- Throws:
FilesProviderException- if list of files cannot be successfully established.
-
rootDirectory
Description copied from class:FilesProviderA root directory for these files, if it exists.Any file that is part of the collection returned by this provider, must exist inside this directory (either directly or in any nested subdirectories).
- Specified by:
rootDirectoryin classFilesProvider- Parameters:
inputContext- the input-context.- Returns:
- a path to this directory.
-
getDirectoryAsPath
The associated directory with the list of files.- Parameters:
inputContext- the input-context.- Returns:
- the associated directory, as a path.
-
matchingFilesForDirectory
public abstract List<File> matchingFilesForDirectory(Path directory, InputManagerParameters parameters) throws FilesProviderException The matching files for this provider that exist in a particular directory.This directory may or may not be searched recursively, depending on implementation.
- Parameters:
directory- the directory.parameters- parameters passed to anInputManagerto generate input-objects.- Returns:
- a newly created list of matching files.
- Throws:
FilesProviderException- if the operation is unable to complete successfully.
-
getDirectoryAsPathEnsureAbsolute
LikegetDirectoryAsPath(org.anchoranalysis.io.input.InputContextParameters)but converts any relative path to absolute one.- Parameters:
inputContext- the input-context.- Returns:
- an absolute path.
-