Class ChainFileListFilter<F>
java.lang.Object
org.springframework.integration.file.filters.CompositeFileListFilter<F>
org.springframework.integration.file.filters.ChainFileListFilter<F>
- Type Parameters:
F
- The type that will be filtered.
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,DiscardAwareFileListFilter<F>
,FileListFilter<F>
,ResettableFileListFilter<F>
,ReversibleFileListFilter<F>
public class ChainFileListFilter<F> extends CompositeFileListFilter<F>
The
CompositeFileListFilter
extension which chains the result
of the previous filter to the next one. If a filter in the chain returns
an empty list, the remaining filters are not invoked.- Since:
- 4.3.7
-
Field Summary
Fields inherited from class org.springframework.integration.file.filters.CompositeFileListFilter
fileFilters
-
Constructor Summary
Constructors Constructor Description ChainFileListFilter()
ChainFileListFilter(java.util.Collection<? extends FileListFilter<F>> fileFilters)
-
Method Summary
Modifier and Type Method Description boolean
accept(F file)
Filter a single file; only called externally ifFileListFilter.supportsSingleFileFiltering()
returns true.java.util.List<F>
filterFiles(F[] 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 org.springframework.integration.file.filters.CompositeFileListFilter
addDiscardCallback, addFilter, addFilters, addFilters, close, isForRecursion, remove, rollback, supportsSingleFileFiltering
-
Constructor Details
-
ChainFileListFilter
public ChainFileListFilter() -
ChainFileListFilter
-
-
Method Details
-
filterFiles
Description copied from interface:FileListFilter
Filters out files and returns the files that are left in a list, or an empty list when a null is passed in.- Specified by:
filterFiles
in interfaceFileListFilter<F>
- Overrides:
filterFiles
in classCompositeFileListFilter<F>
- Parameters:
files
- The files.- Returns:
- The filtered files.
-
accept
Description copied from interface:FileListFilter
Filter a single file; only called externally ifFileListFilter.supportsSingleFileFiltering()
returns true.- Specified by:
accept
in interfaceFileListFilter<F>
- Overrides:
accept
in classCompositeFileListFilter<F>
- Parameters:
file
- the file.- Returns:
- true if the file passes the filter, false to filter.
- See Also:
FileListFilter.supportsSingleFileFiltering()
-