public class SearchDirectory extends FilesProviderWithDirectoryString
By default, the search does not occur recursively, but the bean-property recursive
enables this.
Constructor and Description |
---|
SearchDirectory() |
SearchDirectory(String directory)
Create for a specific directory.
|
Modifier and Type | Method and Description |
---|---|
FilePathMatcher |
getMatcher() |
int |
getMaxDirectoryDepth()
If non-negative the max depth of directories.
|
boolean |
isAcceptDirectoryErrors()
If true, continues when a directory-access-error occurs (logging it), otherwise throws an
exception.
|
boolean |
isIgnoreHidden()
If true, case is ignored in the pattern matching.
|
boolean |
isRecursive()
If true the search is applied recursively over sub-directories.
|
List<File> |
matchingFilesForDirectory(Path directory,
InputManagerParameters parameters)
The matching files for this provider that exist in a particular directory.
|
void |
setAcceptDirectoryErrors(boolean acceptDirectoryErrors)
If true, continues when a directory-access-error occurs (logging it), otherwise throws an
exception.
|
void |
setFileFilterAndDirectory(Path combinedFileFilter)
Sets both the directory and the glob from a string containing both.
|
void |
setIgnoreHidden(boolean ignoreHidden)
If true, case is ignored in the pattern matching.
|
void |
setMatcher(FilePathMatcher matcher) |
void |
setMaxDirectoryDepth(int maxDirectoryDepth)
If non-negative the max depth of directories.
|
void |
setRecursive(boolean recursive)
If true the search is applied recursively over sub-directories.
|
getDirectory, getDirectoryAsPath, isLocalized, setDirectory, setLocalized
create, getDirectoryAsPathEnsureAbsolute, rootDirectory
checkMisconfigured, describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString
public SearchDirectory(String directory)
directory
- the directory to search.public SearchDirectory()
public List<File> matchingFilesForDirectory(Path directory, InputManagerParameters parameters) throws FilesProviderException
FilesProviderWithDirectory
This directory may or may not be searched recursively, depending on implementation.
matchingFilesForDirectory
in class FilesProviderWithDirectory
directory
- the directory.parameters
- parameters passed to an InputManager
to generate input-objects.FilesProviderException
- if the operation is unable to complete successfully.public void setFileFilterAndDirectory(Path combinedFileFilter)
e.g. somefilepath/*.tif or somefilepath\*.tif
combinedFileFilter
- a string with both a directory and a glob, as per above.public FilePathMatcher getMatcher()
public void setMatcher(FilePathMatcher matcher)
public boolean isRecursive()
public void setRecursive(boolean recursive)
public int getMaxDirectoryDepth()
public void setMaxDirectoryDepth(int maxDirectoryDepth)
public boolean isIgnoreHidden()
public void setIgnoreHidden(boolean ignoreHidden)
public boolean isAcceptDirectoryErrors()
public void setAcceptDirectoryErrors(boolean acceptDirectoryErrors)
Copyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.