public class AccumulatorPathVisitor extends CountingPathVisitor
Use with care on large file trees as each visited Path element is remembered.
| Constructor and Description |
|---|
AccumulatorPathVisitor(Counters.PathCounters pathCounter)
Constructs a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj) |
java.util.List<java.nio.file.Path> |
getDirList()
Gets the list of visited directories.
|
java.util.List<java.nio.file.Path> |
getFileList()
Gets the list of visited files.
|
int |
hashCode() |
java.util.List<java.nio.file.Path> |
relativizeDirectories(java.nio.file.Path parent,
boolean sort,
java.util.Comparator<? super java.nio.file.Path> comparator)
Relativizes each directory path with
Path.relativize(Path) against the given parent, optionally
sorting the result. |
java.util.List<java.nio.file.Path> |
relativizeFiles(java.nio.file.Path parent,
boolean sort,
java.util.Comparator<? super java.nio.file.Path> comparator)
Relativizes each file path with
Path.relativize(Path) against the given parent, optionally
sorting the result. |
java.nio.file.FileVisitResult |
visitFile(java.nio.file.Path file,
java.nio.file.attribute.BasicFileAttributes attributes) |
static AccumulatorPathVisitor |
withBigIntegerCounters()
Creates a new instance configured with a BigInteger
Counters.PathCounters. |
static AccumulatorPathVisitor |
withLongCounters()
Creates a new instance configured with a long
Counters.PathCounters. |
getPathCounters, postVisitDirectory, toStringpublic AccumulatorPathVisitor(Counters.PathCounters pathCounter)
pathCounter - How to count path visits.public static AccumulatorPathVisitor withBigIntegerCounters()
Counters.PathCounters.Counters.PathCounters.public static AccumulatorPathVisitor withLongCounters()
Counters.PathCounters.Counters.PathCounters.public boolean equals(java.lang.Object obj)
equals in class CountingPathVisitorpublic java.util.List<java.nio.file.Path> getDirList()
public java.util.List<java.nio.file.Path> getFileList()
public int hashCode()
hashCode in class CountingPathVisitorpublic java.util.List<java.nio.file.Path> relativizeDirectories(java.nio.file.Path parent,
boolean sort,
java.util.Comparator<? super java.nio.file.Path> comparator)
Path.relativize(Path) against the given parent, optionally
sorting the result.parent - A parent pathsort - Whether to sortcomparator - How to sort, null uses default sorting.public java.util.List<java.nio.file.Path> relativizeFiles(java.nio.file.Path parent,
boolean sort,
java.util.Comparator<? super java.nio.file.Path> comparator)
Path.relativize(Path) against the given parent, optionally
sorting the result.parent - A parent pathsort - Whether to sortcomparator - How to sort, null uses default sorting.public java.nio.file.FileVisitResult visitFile(java.nio.file.Path file,
java.nio.file.attribute.BasicFileAttributes attributes)
throws java.io.IOException
visitFile in interface java.nio.file.FileVisitor<java.nio.file.Path>visitFile in class CountingPathVisitorjava.io.IOExceptionCopyright © 2010 - 2022 Adobe. All Rights Reserved