|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.integration.file.DefaultDirectoryScanner
public class DefaultDirectoryScanner
Default directory scanner and base class for other directory scanners. Manages the default interrelations between filtering, scanning and locking.
Constructor Summary | |
---|---|
DefaultDirectoryScanner()
|
Method Summary | |
---|---|
protected java.io.File[] |
listEligibleFiles(java.io.File directory)
Subclasses may refine the listing strategy by overriding this method. |
java.util.List<java.io.File> |
listFiles(java.io.File directory)
Scans the directory according to the strategy particular to this implementation and returns the selected files as a File array. |
void |
setFilter(FileListFilter<java.io.File> filter)
Sets a custom filter to be used by this scanner. |
void |
setLocker(FileLocker locker)
Sets a custom locker to be used by this scanner. |
boolean |
tryClaim(java.io.File file)
Claim the file to process. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultDirectoryScanner()
Method Detail |
---|
public void setFilter(FileListFilter<java.io.File> filter)
DirectoryScanner
setFilter
in interface DirectoryScanner
filter
- the custom filter to be usedpublic final void setLocker(FileLocker locker)
setLocker
in interface DirectoryScanner
locker
- the custom locker to be usedpublic final boolean tryClaim(java.io.File file)
lock
method
and MUST return false if the locker did not grant the lock.
This class takes the minimal implementation and merely delegates to the
locker if set.
- Specified by:
tryClaim
in interface DirectoryScanner
- Parameters:
file
- file to be claimed
- Returns:
- true if the claim was granted false otherwise
public final java.util.List<java.io.File> listFiles(java.io.File directory) throws java.lang.IllegalArgumentException
DirectoryScanner
listFiles
in interface DirectoryScanner
directory
- the directory to scan for files
java.lang.IllegalArgumentException
- if the input is incorrectprotected java.io.File[] listEligibleFiles(java.io.File directory)
directory
- root directory to use for listing
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |