Class SortingVisitor
- java.lang.Object
-
- java.nio.file.SimpleFileVisitor<Path>
-
- org.apache.logging.log4j.core.appender.rolling.action.SortingVisitor
-
- All Implemented Interfaces:
FileVisitor<Path>
public class SortingVisitor extends SimpleFileVisitor<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 List<PathWithAttributes>getSortedPaths()FileVisitResultvisitFile(Path path, BasicFileAttributes attrs)FileVisitResultvisitFileFailed(Path file, IOException ioException)-
Methods inherited from class java.nio.file.SimpleFileVisitor
postVisitDirectory, preVisitDirectory
-
-
-
-
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 FileVisitResult visitFile(Path path, BasicFileAttributes attrs) throws IOException
- Specified by:
visitFilein interfaceFileVisitor<Path>- Overrides:
visitFilein classSimpleFileVisitor<Path>- Throws:
IOException
-
visitFileFailed
public FileVisitResult visitFileFailed(Path file, IOException ioException) throws IOException
- Specified by:
visitFileFailedin interfaceFileVisitor<Path>- Overrides:
visitFileFailedin classSimpleFileVisitor<Path>- Throws:
IOException
-
getSortedPaths
public List<PathWithAttributes> getSortedPaths()
-
-