Class SpecificPathList
A specific list of paths which form the input.
If no paths are specified in the bean, then can be read from the Input-Context
If none are available in the Input-Context, then either the fallback is called if it exists, or an error is thrown
- Author:
- Owen Feehan
-
Constructor Summary
ConstructorsConstructorDescriptionSpecificPathList
(List<String> listPaths) Creates by reusing an existing list.SpecificPathList
(StringList listPaths) Creates by reusing an existing list. -
Method Summary
Modifier and TypeMethodDescriptioncreate
(InputManagerParameters parameters) Creates or provides a list of files.static SpecificPathList
Factory method for creating the class with an empty list of paths.If no paths can be found either from listPaths or the input-context, then the fallback is called if exists, otherwise an error is thrownIf specified, this forms the list of paths which is provided as input.rootDirectory
(InputContextParameters inputContext) A root directory for these files, if it exists.void
setFallback
(FilesProvider fallback) If no paths can be found either from listPaths or the input-context, then the fallback is called if exists, otherwise an error is thrownvoid
setListPaths
(StringList listPaths) If specified, this forms the list of paths which is provided as input.Methods inherited from class org.anchoranalysis.bean.AnchorBean
checkMisconfigured, describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString
-
Constructor Details
-
SpecificPathList
Creates by reusing an existing list.- Parameters:
listPaths
- the list of paths to reuse.
-
SpecificPathList
Creates by reusing an existing list.- Parameters:
listPaths
- the list of paths to reuse.
-
SpecificPathList
public SpecificPathList()
-
-
Method Details
-
createWithEmptyList
Factory method for creating the class with an empty list of paths.- Returns:
- a newly created list that is empty.
-
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.
-
getListPaths
If specified, this forms the list of paths which is provided as input.If not, then the input-context is asked. If still not, then the fallback.
If a list is specified, than the input-directory is derived from the maximally common root of all the files, if it exists.
-
setListPaths
If specified, this forms the list of paths which is provided as input.If not, then the input-context is asked. If still not, then the fallback.
If a list is specified, than the input-directory is derived from the maximally common root of all the files, if it exists.
-
getFallback
If no paths can be found either from listPaths or the input-context, then the fallback is called if exists, otherwise an error is thrown -
setFallback
If no paths can be found either from listPaths or the input-context, then the fallback is called if exists, otherwise an error is thrown
-