org.springframework.integration.file
Class CompositeFileListFilter

java.lang.Object
  extended by org.springframework.integration.file.CompositeFileListFilter
All Implemented Interfaces:
FileListFilter

public class CompositeFileListFilter
extends java.lang.Object
implements FileListFilter

Composition that delegates to multiple FileFilters. The composition is AND based, meaning that a file must pass through each filter's #filterFiles(File) method in order to be accepted by the composite.

Author:
Iwein Fuld, Mark Fisher

Constructor Summary
CompositeFileListFilter(java.util.Collection<FileListFilter> fileFilters)
           
CompositeFileListFilter(FileListFilter... fileFilters)
           
 
Method Summary
 CompositeFileListFilter addFilter(FileListFilter... filters)
           
 CompositeFileListFilter addFilters(java.util.Collection<FileListFilter> filtersToAdd)
          Add the new filters to this CompositeFileFilter while maintaining the existing filters.
 java.util.List<java.io.File> filterFiles(java.io.File[] files)
          Filters out files and returns the files that are left in a list, or an empty list when a null is passed in.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompositeFileListFilter

public CompositeFileListFilter(FileListFilter... fileFilters)

CompositeFileListFilter

public CompositeFileListFilter(java.util.Collection<FileListFilter> fileFilters)
Method Detail

filterFiles

public java.util.List<java.io.File> filterFiles(java.io.File[] files)
Filters out files and returns the files that are left in a list, or an empty list when a null is passed in. This implementation delegates to a collection of filters and returns only files that pass all the filters.

Specified by:
filterFiles in interface FileListFilter

addFilter

public CompositeFileListFilter addFilter(FileListFilter... filters)
Parameters:
filters - one or more new filters to add
Returns:
this CompositeFileFilter instance with the added filters
See Also:
addFilters(Collection)

addFilters

public CompositeFileListFilter addFilters(java.util.Collection<FileListFilter> filtersToAdd)
Add the new filters to this CompositeFileFilter while maintaining the existing filters.

Parameters:
filtersToAdd - a list of filters to add
Returns:
this CompositeFileFilter instance with the added filters