org.springframework.integration.file.filters
Class AcceptOnceFileListFilter<F>

java.lang.Object
  extended by org.springframework.integration.file.filters.AbstractFileListFilter<F>
      extended by org.springframework.integration.file.filters.AcceptOnceFileListFilter<F>
All Implemented Interfaces:
FileListFilter<F>

public class AcceptOnceFileListFilter<F>
extends AbstractFileListFilter<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.

Since:
1.0.0

Constructor Summary
AcceptOnceFileListFilter()
          Creates an AcceptOnceFileListFilter based on an unbounded queue.
AcceptOnceFileListFilter(int maxCapacity)
          Creates an AcceptOnceFileListFilter that is based on a bounded queue.
 
Method Summary
 boolean accept(F file)
          Subclasses must implement this method.
 
Methods inherited from class org.springframework.integration.file.filters.AbstractFileListFilter
filterFiles
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AcceptOnceFileListFilter

public AcceptOnceFileListFilter(int maxCapacity)
Creates an AcceptOnceFileListFilter that is based on a bounded queue. If the queue overflows, files that fall out will be passed through this filter again if passed to the AbstractFileListFilter.filterFiles(Object[])

Parameters:
maxCapacity - the maximum number of Files to maintain in the 'seen' queue.

AcceptOnceFileListFilter

public AcceptOnceFileListFilter()
Creates an AcceptOnceFileListFilter based on an unbounded queue.

Method Detail

accept

public boolean accept(F file)
Description copied from class: AbstractFileListFilter
Subclasses must implement this method.

Specified by:
accept in class AbstractFileListFilter<F>