Class CompositeFileFilter
- java.lang.Object
-
- com.adaptris.core.fs.CompositeFileFilter
-
- All Implemented Interfaces:
java.io.FileFilter
public class CompositeFileFilter extends java.lang.Object implements java.io.FileFilter
AFileFilter
that contains other filters.It is designed for use with either the FsConsumer or FtpConsumer, this filter creates its underlying filters from a single
__@@__
separated string (this notation was chosen so that it is unlikely to be used as a pattern matching sequence).The format of the string required is
'FILTER_TYPE'='filter-expression'
where the following types of filter are understood (case matters).- NewerThan is equivalent to using
NewerThan
- OlderThan is equivalent to using
OlderThan
- SizeGT is equivalent to using
SizeGreaterThan
SizeGreaterThan - SizeGTE is equivalent to using
SizeGreaterThanOrEqual
- SizeLT is equivalent to using
SizeLessThan
- SizeLTE is equivalent to using
SizeLessThanOrEqual
- Regex is equivalent to using
org.apache.commons.io.filefilter.RegexFileFilter
- since 3.7.0
In the event of a unknown filter type being used, it will be assumed to be a fully qualified classname which will be constructed using reflection; the filter-expression will be passed in as the sole constructor argument.
The filter-expression value is something that is understood by the filter in question. e.g. the size in bytes for Size based filters, any errors encountered attempting to create filter results in the filter being ignored.
The filter only accepts the file if all the underlying filters accept the file, thus this represents an implicit AND condition. So for example we would use
SizeGT=4096__@@__Regex=.*\.xml
to match all files ending with.xml
whose size is greater than 4096 bytes
-
-
Constructor Summary
Constructors Constructor Description CompositeFileFilter(java.lang.String filterExpression)
Create the filefilter using the specified filterExpression.CompositeFileFilter(java.lang.String filterExpression, boolean quiet)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
accept(java.io.File pathname)
-
-
-
Constructor Detail
-
CompositeFileFilter
public CompositeFileFilter(java.lang.String filterExpression)
Create the filefilter using the specified filterExpression.- Parameters:
filterExpression
- the filter expression.
-
CompositeFileFilter
public CompositeFileFilter(java.lang.String filterExpression, boolean quiet)
-
-