Class PathUtils.RelativeSortedPaths

  • Enclosing class:
    PathUtils

    private static final class PathUtils.RelativeSortedPaths
    extends java.lang.Object
    Private worker/holder that computes and tracks relative path names and their equality. We reuse the sorted relative lists when comparing directories.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) boolean equals  
      (package private) java.util.List<java.nio.file.Path> relativeFileList1  
      (package private) java.util.List<java.nio.file.Path> relativeFileList2  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private RelativeSortedPaths​(java.nio.file.Path dir1, java.nio.file.Path dir2, int maxDepth, java.nio.file.LinkOption[] linkOptions, java.nio.file.FileVisitOption[] fileVisitOptions)
      Constructs and initializes a new instance by accumulating directory and file info.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      private static boolean equalsIgnoreFileSystem​(java.nio.file.Path path1, java.nio.file.Path path2)  
      private static boolean equalsIgnoreFileSystem​(java.util.List<java.nio.file.Path> list1, java.util.List<java.nio.file.Path> list2)
      Compares lists of paths regardless of their file systems.
      (package private) static java.lang.String extractKey​(java.lang.String separator, java.lang.String string)  
      • Methods inherited from class java.lang.Object

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

      • equals

        final boolean equals
      • relativeFileList1

        final java.util.List<java.nio.file.Path> relativeFileList1
      • relativeFileList2

        final java.util.List<java.nio.file.Path> relativeFileList2
    • Constructor Detail

      • RelativeSortedPaths

        private RelativeSortedPaths​(java.nio.file.Path dir1,
                                    java.nio.file.Path dir2,
                                    int maxDepth,
                                    java.nio.file.LinkOption[] linkOptions,
                                    java.nio.file.FileVisitOption[] fileVisitOptions)
                             throws java.io.IOException
        Constructs and initializes a new instance by accumulating directory and file info.
        Parameters:
        dir1 - First directory to compare.
        dir2 - Seconds directory to compare.
        maxDepth - See Files.walkFileTree(Path,Set,int,FileVisitor).
        linkOptions - Options indicating how symbolic links are handled.
        fileVisitOptions - See Files.walkFileTree(Path,Set,int,FileVisitor).
        Throws:
        java.io.IOException - if an I/O error is thrown by a visitor method.
    • Method Detail

      • equalsIgnoreFileSystem

        private static boolean equalsIgnoreFileSystem​(java.util.List<java.nio.file.Path> list1,
                                                      java.util.List<java.nio.file.Path> list2)
        Compares lists of paths regardless of their file systems.
        Parameters:
        list1 - the first list.
        list2 - the second list.
        Returns:
        whether the lists are equal.
      • equalsIgnoreFileSystem

        private static boolean equalsIgnoreFileSystem​(java.nio.file.Path path1,
                                                      java.nio.file.Path path2)
      • extractKey

        static java.lang.String extractKey​(java.lang.String separator,
                                           java.lang.String string)