org.springframework.integration.file
Class AcceptOnceFileListFilter

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

public class AcceptOnceFileListFilter
extends AbstractFileListFilter

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.

Author:
Iwein Fuld

Constructor Summary
AcceptOnceFileListFilter()
          Creates an AcceptOnceFileFilter based on an unbounded queue.
AcceptOnceFileListFilter(int maxCapacity)
          Creates an AcceptOnceFileFilter that is based on a bounded queue.
 
Method Summary
protected  boolean accept(java.io.File pathname)
          Subclasses must implement this method.
 
Methods inherited from class org.springframework.integration.file.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 AcceptOnceFileFilter 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(File[]) method.

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

AcceptOnceFileListFilter

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

Method Detail

accept

protected boolean accept(java.io.File pathname)
Description copied from class: AbstractFileListFilter
Subclasses must implement this method.

Specified by:
accept in class AbstractFileListFilter