public class SortingVisitor
extends java.nio.file.SimpleFileVisitor<java.nio.file.Path>
Modifier and Type | Field and Description |
---|---|
private java.util.List<PathWithAttributes> |
collected |
private PathSorter |
sorter |
Constructor and Description |
---|
SortingVisitor(PathSorter sorter)
Constructs a new DeletingVisitor.
|
Modifier and Type | Method and Description |
---|---|
java.util.List<PathWithAttributes> |
getSortedPaths() |
java.nio.file.FileVisitResult |
visitFile(java.nio.file.Path path,
java.nio.file.attribute.BasicFileAttributes attrs) |
private final PathSorter sorter
private final java.util.List<PathWithAttributes> collected
public SortingVisitor(PathSorter sorter)
basePath
- used to relativize pathspathFilters
- objects that need to confirm whether a file can be deletedpublic java.nio.file.FileVisitResult visitFile(java.nio.file.Path path, java.nio.file.attribute.BasicFileAttributes attrs) throws java.io.IOException
visitFile
in interface java.nio.file.FileVisitor<java.nio.file.Path>
visitFile
in class java.nio.file.SimpleFileVisitor<java.nio.file.Path>
java.io.IOException
public java.util.List<PathWithAttributes> getSortedPaths()