Class HeadDirectoryScanner
java.lang.Object
org.springframework.integration.file.DefaultDirectoryScanner
org.springframework.integration.file.HeadDirectoryScanner
- All Implemented Interfaces:
- DirectoryScanner
A custom scanner that only returns the first 
maxNumberOfFiles
 elements from a directory listing. This is useful to limit the number of File
 objects in memory and therefore mutually exclusive with AcceptOnceFileListFilter.
 It should not be used in conjunction with an AcceptOnceFileListFilter.- Since:
- 2.0
- Author:
- Iwein Fuld, Gary Russell
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionfinal voidsetFilter(FileListFilter<File> filter) Sets a custom filter to be used by this scanner.Methods inherited from class org.springframework.integration.file.DefaultDirectoryScannergetFilter, getLocker, listEligibleFiles, listFiles, setLocker, tryClaim
- 
Constructor Details- 
HeadDirectoryScannerpublic HeadDirectoryScanner(int maxNumberOfFiles) 
 
- 
- 
Method Details- 
setFilterDescription copied from interface:DirectoryScannerSets a custom filter to be used by this scanner. The filter will get a chance to reject files before the scanner presents them through its listFiles method. A scanner may use additional filtering that is out of the control of the provided filter.- Specified by:
- setFilterin interface- DirectoryScanner
- Overrides:
- setFilterin class- DefaultDirectoryScanner
- Parameters:
- filter- the custom filter to be used
 
 
-