org.springframework.integration.file.entries
Class AcceptOnceEntryFileListFilter<T>

java.lang.Object
  extended by org.springframework.integration.file.entries.AbstractEntryListFilter<T>
      extended by org.springframework.integration.file.entries.AcceptOnceEntryFileListFilter<T>
All Implemented Interfaces:
InitializingBean, EntryListFilter<T>
Direct Known Subclasses:
AcceptOnceFileListFilter

public class AcceptOnceEntryFileListFilter<T>
extends AbstractEntryListFilter<T>

EntryListFilter 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
AcceptOnceEntryFileListFilter()
          Creates an AcceptOnceFileFilter based on an unbounded queue.
AcceptOnceEntryFileListFilter(int maxCapacity)
          Creates an AcceptOnceEntryFileListFilter that is based on a bounded queue.
 
Method Summary
 boolean accept(T pathname)
           
 
Methods inherited from class org.springframework.integration.file.entries.AbstractEntryListFilter
afterPropertiesSet, filterEntries
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AcceptOnceEntryFileListFilter

public AcceptOnceEntryFileListFilter(int maxCapacity)
Creates an AcceptOnceEntryFileListFilter 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 AbstractEntryListFilter.filterEntries(Object[]) method.

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

AcceptOnceEntryFileListFilter

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

Method Detail

accept

public boolean accept(T pathname)
Specified by:
accept in class AbstractEntryListFilter<T>