Class FilesProviderUnary
- Direct Known Subclasses:
FilterForExistingFiles
,Limit
,RandomOrder
,RemoveMatching
,SortAlphabetically
Like
FilesProvider
but employs a unary operator on a call to an existing FilesProvider
.- Author:
- Owen Feehan
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreate
(InputManagerParameters parameters) Creates or provides a list of files.getFiles()
rootDirectory
(InputContextParameters inputContext) A root directory for these files, if it exists.void
setFiles
(FilesProvider files) 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:FilesProvider
Creates or provides a list of files.- Specified by:
create
in 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 FilesProviderException Description copied from class:FilesProvider
A 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:
rootDirectory
in 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 FilesProviderException Transform 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
-