Iterator
to iterate over the nodes of a file tree.
try (FileTreeIterator iterator = new FileTreeIterator(start, maxDepth, options)) { while (iterator.hasNext()) { Event ev = iterator.next(); Path path = ev.file(); BasicFileAttributes attrs = ev.attributes(); } }
Modifier and Type | Field and Description |
---|---|
private FileTreeWalker. | |
private final FileTreeWalker |
Access | Constructor and Description |
---|---|
pack-priv | FileTreeIterator(Path start, int maxDepth, FileVisitOption... options)
Creates a new iterator to walk the file tree starting at the given file. |
Modifier and Type | Method and Description |
---|---|
public void | close()
Implements java. Closes this stream and releases any system resources associated with it. |
private void | |
public boolean | |
public FileTreeWalker. |
next | back to summary |
---|---|
private FileTreeWalker. |
walker | back to summary |
---|---|
private final FileTreeWalker walker |
FileTreeIterator | back to summary |
---|---|
pack-priv FileTreeIterator(Path start, int maxDepth, FileVisitOption... options) throws IOException Creates a new iterator to walk the file tree starting at the given file.
|
close | back to summary |
---|---|
public void close() Implements java. Doc from java. Closes this stream and releases any system resources associated with it. If the stream is already closed then invoking this method has no effect. As noted in
|
fetchNextIfNeeded | back to summary |
---|---|
private void fetchNextIfNeeded() |
hasNext | back to summary |
---|---|
public boolean hasNext() Implements java. Doc from java. Returns
|
next | back to summary |
---|---|
public FileTreeWalker. Implements java. Doc from java. Returns the next element in the iteration.
|