public class SpecificPathList extends FilesProvider
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
Constructor and Description |
---|
SpecificPathList() |
SpecificPathList(List<String> listPaths)
Creates by reusing an existing list.
|
SpecificPathList(StringList listPaths)
Creates by reusing an existing list.
|
Modifier and Type | Method and Description |
---|---|
List<File> |
create(InputManagerParameters parameters)
Creates or provides a list of files.
|
static SpecificPathList |
createWithEmptyList()
Factory method for creating the class with an empty list of paths.
|
FilesProvider |
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
|
StringList |
getListPaths()
If specified, this forms the list of paths which is provided as input.
|
Optional<Path> |
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 thrown
|
void |
setListPaths(StringList listPaths)
If specified, this forms the list of paths which is provided as input.
|
checkMisconfigured, describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString
public SpecificPathList(List<String> listPaths)
listPaths
- the list of paths to reuse.public SpecificPathList(StringList listPaths)
listPaths
- the list of paths to reuse.public SpecificPathList()
public static SpecificPathList createWithEmptyList()
public List<File> create(InputManagerParameters parameters) throws FilesProviderException
FilesProvider
create
in class FilesProvider
parameters
- parameters influencing how input-files are obtained.FilesProviderException
- if list of files cannot be successfully established.public Optional<Path> rootDirectory(InputContextParameters inputContext) throws FilesProviderException
FilesProvider
Any file that is part of the collection returned by this provider, must exist inside this directory (either directly or in any nested subdirectories).
rootDirectory
in class FilesProvider
inputContext
- the input-context.FilesProviderException
- if an error occurs establishing the root directory.public StringList getListPaths()
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.
public void setListPaths(StringList listPaths)
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.
public FilesProvider getFallback()
public void setFallback(FilesProvider fallback)
Copyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.