T - this instance concrete type. It allows to extend this class while allowing setter chainsA - The concrete implementation of FileAttributes that this builder uses to assert the file propertiespublic abstract class FileMatcher<T extends FileMatcher<T,A>,A extends FileAttributes> extends Object
Predicate which verifies that a FileAttributes instance is compliant with a number of criteria. This
builder is stateful and not thread-safe. A new instance should be use per each desired Predicate.
This builder can either be used programmatically or through Mule's SDK since its internal state is annotated with the
Parameter annotation.
Criteria are evaluated using an AND operator, meaning that for the predicate to accept a file, ALL the criteria must
be met.
None of the criteria fields are mandatory. If a particular criterion is not specified, then it's simply not applied on the evaluation.
The class is also given the "matcher" alias to make it DSL/XML friendly.
| Modifier and Type | Field and Description |
|---|---|
protected static TimeSinceFunction |
FILE_TIME_SINCE |
protected static TimeUntilFunction |
FILE_TIME_UNTIL |
| Constructor and Description |
|---|
FileMatcher() |
| Modifier and Type | Method and Description |
|---|---|
protected Predicate<A> |
addConditions(Predicate<A> predicate)
|
Predicate<A> |
build()
Builds a
Predicate from the criterias in this builder's state. |
MatchPolicy |
getDirectories() |
String |
getFilenamePattern() |
Long |
getMaxSize() |
Long |
getMinSize() |
String |
getPathPattern() |
MatchPolicy |
getRegularFiles() |
MatchPolicy |
getSymLinks() |
T |
setCaseSensitive(boolean caseSensitive)
Whether files are matched in a case-sensitive manner.
|
T |
setDirectories(MatchPolicy directories) |
T |
setFilenamePattern(String filenamePattern) |
T |
setFileSeparator(String fileSeparator)
Separator used in paths (e.g.
|
T |
setMaxSize(Long maxSize) |
T |
setMinSize(Long minSize) |
T |
setPathPattern(String pathPattern) |
T |
setRegularFiles(MatchPolicy regularFiles) |
T |
setSymLinks(MatchPolicy symLinks) |
protected static final TimeUntilFunction FILE_TIME_UNTIL
protected static final TimeSinceFunction FILE_TIME_SINCE
public Predicate<A> build()
Predicate from the criterias in this builder's state.Predicatepublic String getFilenamePattern()
public String getPathPattern()
public MatchPolicy getDirectories()
public MatchPolicy getRegularFiles()
public MatchPolicy getSymLinks()
public Long getMinSize()
public Long getMaxSize()
public T setDirectories(MatchPolicy directories)
public T setRegularFiles(MatchPolicy regularFiles)
public T setSymLinks(MatchPolicy symLinks)
public T setCaseSensitive(boolean caseSensitive)
Copyright © 2003–2022 MuleSoft, Inc.. All rights reserved.