public class RecursiveDirectoryScanner extends DefaultDirectoryScanner
DefaultDirectoryScanner
extension which walks through the directory tree
using Files.walk(Path, int, FileVisitOption...)
.
By default this class visits all levels of the file tree without any FileVisitOption
s.
Files.walk(java.nio.file.Path, int, java.nio.file.FileVisitOption...)
Constructor and Description |
---|
RecursiveDirectoryScanner() |
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 |
setFileVisitOptions(FileVisitOption... fileVisitOptions)
The options to configure the traversal.
|
void |
setMaxDepth(int maxDepth)
The maximum number of directory levels to visit.
|
getFilter, getLocker, listEligibleFiles, setFilter, setLocker, tryClaim
public void setMaxDepth(int maxDepth)
maxDepth
- the maximum number of directory levels to visitpublic void setFileVisitOptions(FileVisitOption... fileVisitOptions)
fileVisitOptions
- options to configure the traversalpublic List<File> listFiles(File directory) throws IllegalArgumentException
DirectoryScanner
listFiles
in interface DirectoryScanner
listFiles
in class DefaultDirectoryScanner
directory
- the directory to scan for filesIllegalArgumentException
- if the input is incorrect