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.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<PathWithAttributes>collectedprivate static LoggerLOGGERprivate PathSortersorter
-
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.FileVisitResultvisitFile(java.nio.file.Path path, java.nio.file.attribute.BasicFileAttributes attrs)java.nio.file.FileVisitResultvisitFileFailed(java.nio.file.Path file, java.io.IOException ioException)
-
-
-
Field Detail
-
LOGGER
private static final Logger LOGGER
-
sorter
private final PathSorter sorter
-
collected
private final java.util.List<PathWithAttributes> collected
-
-
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:
visitFilein interfacejava.nio.file.FileVisitor<java.nio.file.Path>- Overrides:
visitFilein classjava.nio.file.SimpleFileVisitor<java.nio.file.Path>- Throws:
java.io.IOException
-
visitFileFailed
public java.nio.file.FileVisitResult visitFileFailed(java.nio.file.Path file, java.io.IOException ioException) throws java.io.IOException- Specified by:
visitFileFailedin interfacejava.nio.file.FileVisitor<java.nio.file.Path>- Overrides:
visitFileFailedin classjava.nio.file.SimpleFileVisitor<java.nio.file.Path>- Throws:
java.io.IOException
-
getSortedPaths
public java.util.List<PathWithAttributes> getSortedPaths()
-
-