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<Path> pathFilter)
Adds a filter to the walked paths.
|
DirectoryWalker |
filterRoot()
Filters away the
rootDir. |
com.google.common.collect.ImmutableList<Path> |
walk()
Walks
rootDir and returns the walked files. |
com.google.common.collect.ImmutableList<Path> |
walk(PathConsumer pathConsumer)
Walks
rootDir and applies pathConsumer to each file. |
public DirectoryWalker(Path rootDir) throws NotDirectoryException
NotDirectoryExceptionpublic DirectoryWalker filter(Predicate<Path> pathFilter)
public DirectoryWalker filterRoot()
rootDir.public com.google.common.collect.ImmutableList<Path> walk(PathConsumer pathConsumer) throws IOException
IOExceptionpublic com.google.common.collect.ImmutableList<Path> walk() throws IOException
rootDir and returns the walked files.IOExceptionCopyright © 2018. All rights reserved.