Class AcceptOnceFileListFilter<F>

java.lang.Object
org.springframework.integration.file.filters.AbstractFileListFilter<F>
org.springframework.integration.file.filters.AcceptOnceFileListFilter<F>
Type Parameters:
F - the file type.
All Implemented Interfaces:
FileListFilter<F>, ResettableFileListFilter<F>, ReversibleFileListFilter<F>

public class AcceptOnceFileListFilter<F>
extends AbstractFileListFilter<F>
implements ReversibleFileListFilter<F>, ResettableFileListFilter<F>
FileListFilter that passes files only one time. This can conveniently be used to prevent duplication of files, as is done in FileReadingMessageSource.

This implementation is thread safe.

  • Constructor Summary

    Constructors 
    Constructor Description
    AcceptOnceFileListFilter()
    Creates an AcceptOnceFileListFilter based on an unbounded queue.
    AcceptOnceFileListFilter​(int maxCapacity)
    Creates an AcceptOnceFileListFilter that is based on a bounded queue.
  • Method Summary

    Modifier and Type Method Description
    boolean accept​(F file)
    Subclasses must implement this method.
    boolean remove​(F fileToRemove)
    Remove the specified file from the filter, so it will pass on the next attempt.
    void rollback​(F file, java.util.List<F> files)
    Indicate that not all files previously passed by this filter (in FileListFilter.filterFiles(Object[]) have been processed; the file must be in the list of files; it, and all files after it, will be considered to have not been processed and will be considered next time.

    Methods inherited from class org.springframework.integration.file.filters.AbstractFileListFilter

    filterFiles, supportsSingleFileFiltering

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.springframework.integration.file.filters.FileListFilter

    filterFiles, isForRecursion, supportsSingleFileFiltering