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 and Description |
|---|
AcceptOnceFileListFilter()
Creates an AcceptOnceFileListFilter based on an unbounded queue.
|
AcceptOnceFileListFilter(int maxCapacity)
Creates an AcceptOnceFileListFilter that is based on a bounded queue.
|
| Modifier and Type | Method and 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,
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. |
filterFiles, supportsSingleFileFilteringclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitfilterFiles, supportsSingleFileFilteringpublic AcceptOnceFileListFilter(int maxCapacity)
AbstractFileListFilter.filterFiles(Object[])maxCapacity - the maximum number of Files to maintain in the 'seen' queue.public AcceptOnceFileListFilter()
public boolean accept(F file)
AbstractFileListFilteraccept in interface FileListFilter<F>accept in class AbstractFileListFilter<F>file - The file.FileListFilter.supportsSingleFileFiltering()public void rollback(F file, List<F> files)
ReversibleFileListFilterFileListFilter.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.rollback in interface ReversibleFileListFilter<F>file - the file which failed.files - the list of files that were returned by FileListFilter.filterFiles(Object[]).public boolean remove(F fileToRemove)
ResettableFileListFilterremove in interface ResettableFileListFilter<F>fileToRemove - the element to remove.