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 |
---|---|
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 |
setFileVisitOptions(java.nio.file.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(java.nio.file.FileVisitOption... fileVisitOptions)
fileVisitOptions
- options to configure the traversalpublic java.util.List<java.io.File> listFiles(java.io.File directory) throws java.lang.IllegalArgumentException
DirectoryScanner
listFiles
in interface DirectoryScanner
listFiles
in class DefaultDirectoryScanner
directory
- the directory to scan for filesjava.lang.IllegalArgumentException
- if the input is incorrect