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,A extends FileAttributes> extends Object
Predicate which verifies that a FileAttributes instance is compliant with a number of criterias. 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.
Criterias are evaluated using an AND operator, meaning that for the predicate to accept a file, ALL the criterias must
be complied with.
None of the criteria fields are mandatory. If a particular criteria 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 |
setDirectories(MatchPolicy directories) |
T |
setFilenamePattern(String filenamePattern) |
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)
Copyright © 2003–2017 MuleSoft, Inc.. All rights reserved.