public class MatchExtensions extends FilePathMatcher
The extensions are always checked in a case-insensitive manner.
Constructor and Description |
---|
MatchExtensions() |
MatchExtensions(String... extension)
Create for specific extensions.
|
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.
|
StringSet |
getExtensions()
A set of file-extensions (without the period), one of which must match the end of a path.
|
FilePathMatcher |
getMatcher()
A secondary matcher, which is required additionally match (as well as the extension).
|
boolean |
isPrioritizeInputContext()
When true, any extensions available in the input-context are prioritized ahead of
extensions . |
void |
setExtensions(StringSet extensions)
A set of file-extensions (without the period), one of which must match the end of a path.
|
void |
setMatcher(FilePathMatcher matcher)
A secondary matcher, which is required additionally match (as well as the extension).
|
void |
setPrioritizeInputContext(boolean prioritizeInputContext)
When true, any extensions available in the input-context are prioritized ahead of
extensions . |
matchingFiles, matchingFiles
checkMisconfigured, describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString
public MatchExtensions(String... extension)
extension
- an extension.public MatchExtensions()
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 FilePathMatcher getMatcher()
public void setMatcher(FilePathMatcher matcher)
public StringSet getExtensions()
If an empty set is passed then, no check occurs, and no extension is checked.
public void setExtensions(StringSet extensions)
If an empty set is passed then, no check occurs, and no extension is checked.
public boolean isPrioritizeInputContext()
extensions
.public void setPrioritizeInputContext(boolean prioritizeInputContext)
extensions
.Copyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.