Class SortingVisitor
- java.lang.Object
-
- java.nio.file.SimpleFileVisitor<java.nio.file.Path>
-
- org.apache.logging.log4j.core.appender.rolling.action.SortingVisitor
-
- All Implemented Interfaces:
java.nio.file.FileVisitor<java.nio.file.Path>
public class SortingVisitor extends java.nio.file.SimpleFileVisitor<java.nio.file.Path>
FileVisitor that sorts files.
-
-
Constructor Summary
Constructors Constructor Description SortingVisitor(PathSorter sorter)
Constructs a new DeletingVisitor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<PathWithAttributes>
getSortedPaths()
java.nio.file.FileVisitResult
visitFile(java.nio.file.Path path, java.nio.file.attribute.BasicFileAttributes attrs)
-
-
-
Constructor Detail
-
SortingVisitor
public SortingVisitor(PathSorter sorter)
Constructs a new DeletingVisitor.- Parameters:
basePath
- used to relativize pathspathFilters
- objects that need to confirm whether a file can be deleted
-
-
Method Detail
-
visitFile
public java.nio.file.FileVisitResult visitFile(java.nio.file.Path path, java.nio.file.attribute.BasicFileAttributes attrs) throws java.io.IOException
- Specified by:
visitFile
in interfacejava.nio.file.FileVisitor<java.nio.file.Path>
- Overrides:
visitFile
in classjava.nio.file.SimpleFileVisitor<java.nio.file.Path>
- Throws:
java.io.IOException
-
getSortedPaths
public java.util.List<PathWithAttributes> getSortedPaths()
-
-