Class 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)  
      • Methods inherited from class java.nio.file.SimpleFileVisitor

        postVisitDirectory, preVisitDirectory, visitFileFailed
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SortingVisitor

        public SortingVisitor​(PathSorter sorter)
        Constructs a new DeletingVisitor.
        Parameters:
        basePath - used to relativize paths
        pathFilters - 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 interface java.nio.file.FileVisitor<java.nio.file.Path>
        Overrides:
        visitFile in class java.nio.file.SimpleFileVisitor<java.nio.file.Path>
        Throws:
        java.io.IOException