Class FilesProviderUnary
Object
org.anchoranalysis.bean.AnchorBean<FilesProvider>
org.anchoranalysis.io.input.bean.files.FilesProvider
org.anchoranalysis.io.input.bean.files.FilesProviderUnary
public abstract class FilesProviderUnary extends FilesProvider
Like
FilesProvider but employs a unary operator on a call to an existing FilesProvider.- Author:
- Owen Feehan
-
Constructor Summary
Constructors Constructor Description FilesProviderUnary() -
Method Summary
Modifier and Type Method Description List<File>create(InputManagerParameters parameters)Creates or provides a list of files.FilesProvidergetFiles()Optional<Path>rootDirectory(InputContextParameters inputContext)A root directory for these files, if it exists.voidsetFiles(FilesProvider files)protected abstract List<File>transform(List<File> source, boolean debugMode)Transform an existing collection of files.Methods inherited from class org.anchoranalysis.bean.AnchorBean
checkMisconfigured, describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString
-
Constructor Details
-
FilesProviderUnary
public FilesProviderUnary()
-
-
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
public Optional<Path> rootDirectory(InputContextParameters inputContext) throws FilesProviderExceptionDescription 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.
- Throws:
FilesProviderException- if an error occurs establishing the root directory.
-
transform
protected abstract List<File> transform(List<File> source, boolean debugMode) throws FilesProviderExceptionTransform an existing collection of files.Note that the incoming collection of files may be modified, and can no longer be used in its original form after this method call.
- Parameters:
source- the incoming files (which may be consumed and modified).debugMode- whether we are executing in debug-mode or not- Returns:
- the transformed (outgoing) files.
- Throws:
FilesProviderException- if unable to complete the transform operation successfully.
-
getFiles
-
setFiles
-