public class MatchGlob extends FilePathMatcher
Please see FileSystem.getPathMatcher(java.lang.String)
for the syntax of the glob.
In summary, a single wildcard like *.jpg
will match only files in the top-level
directory, whereas a double wildcard like **.jpg
will match files in all subdirectories
recursively.
Modifier and Type | Method and Description |
---|---|
protected boolean |
canMatchSubdirectories()
Determines if it possible to match a file in a subdirectory.
|
protected CheckedPredicate<Path,IOException> |
createMatcherFile(Path directory,
Optional<InputContextParameters> inputContext)
Create a predicate to be used for matching against path.
|
String |
getGlob()
The string describing a glob e.g.
|
void |
setGlob(String glob)
The string describing a glob e.g.
|
matchingFiles, matchingFiles
checkMisconfigured, describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString
public MatchGlob()
public MatchGlob(String glob)
protected CheckedPredicate<Path,IOException> createMatcherFile(Path directory, Optional<InputContextParameters> inputContext) throws InputReadFailedException
FilePathMatcher
createMatcherFile
in class FilePathMatcher
directory
- the directory being searched. Only paths in this directory (or its
subdirectories) will ever be passed to the predicate.inputContext
- the input-context.directory
.InputReadFailedException
- if the testing of the predicate fails.protected boolean canMatchSubdirectories()
FilePathMatcher
If it impossible to match a subdirectory, this allows us to disable any recursive search, as it is pointless effort.
canMatchSubdirectories
in class FilePathMatcher
createMatcherFile
to match
a file in a subdirectory, false otherwise.public String getGlob()
If empty, then it is populated from the InputContextParameters
where they exist.
public void setGlob(String glob)
If empty, then it is populated from the InputContextParameters
where they exist.
Copyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.