public interface DirectoryScanner
Modifier and Type | Method and Description |
---|---|
List<File> |
listFiles(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<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(File file)
Claim the file to process.
|
List<File> listFiles(File directory) throws IllegalArgumentException
directory
- the directory to scan for filesIllegalArgumentException
- if the input is incorrectvoid setFilter(FileListFilter<File> filter)
filter
- the custom filter to be usedvoid setLocker(FileLocker locker)
locker
- the custom locker to be usedboolean tryClaim(File file)
lock
method
and MUST return false
if the locker did not grant the lock.file
- file to be claimed