Class CompositeFileFilter

  • All Implemented Interfaces:
    java.io.FileFilter

    public class CompositeFileFilter
    extends java.lang.Object
    implements java.io.FileFilter
    A FileFilter 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).

    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__@@__Perl=.*\.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)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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)
    • Method Detail

      • accept

        public boolean accept​(java.io.File pathname)
        Specified by:
        accept in interface java.io.FileFilter
        See Also:
        FileFilter.accept(java.io.File)