public class DirectoryWalker extends Object
| Constructor and Description |
|---|
DirectoryWalker(Path rootDir)
Initialize with a root directory to walk.
|
| Modifier and Type | Method and Description |
|---|---|
DirectoryWalker |
filter(Predicate<? super Path> pathFilter)
Adds a filter to the walked paths.
|
List<Path> |
walk()
Walks
rootDir and returns the walked files. |
List<Path> |
walk(PathConsumer pathConsumer)
Walks
rootDir and applies pathConsumer to each file. |
public DirectoryWalker(Path rootDir) throws NotDirectoryException
NotDirectoryExceptionpublic DirectoryWalker filter(@Nullable Predicate<? super Path> pathFilter)
public List<Path> walk(PathConsumer pathConsumer) throws IOException
IOExceptionpublic List<Path> walk() throws IOException
rootDir and returns the walked files.IOExceptionCopyright © 2018. All rights reserved.