Class MockPath

  • All Implemented Interfaces:
    java.lang.Comparable<java.nio.file.Path>, java.lang.Iterable<java.nio.file.Path>, java.nio.file.Path, java.nio.file.Watchable

    public class MockPath
    extends java.lang.Object
    implements java.nio.file.Path
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.nio.file.FileSystem fs  
      private java.lang.String path  
    • Constructor Summary

      Constructors 
      Constructor Description
      MockPath​(java.lang.String path)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compareTo​(java.nio.file.Path other)  
      boolean endsWith​(java.lang.String other)  
      boolean endsWith​(java.nio.file.Path other)  
      java.nio.file.Path getFileName()  
      java.nio.file.FileSystem getFileSystem()  
      java.nio.file.Path getName​(int index)  
      int getNameCount()  
      java.nio.file.Path getParent()  
      java.nio.file.Path getRoot()  
      boolean isAbsolute()  
      java.util.Iterator<java.nio.file.Path> iterator()  
      java.nio.file.Path normalize()  
      java.nio.file.WatchKey register​(java.nio.file.WatchService watcher, java.nio.file.WatchEvent.Kind<?>... events)  
      java.nio.file.WatchKey register​(java.nio.file.WatchService watcher, java.nio.file.WatchEvent.Kind<?>[] events, java.nio.file.WatchEvent.Modifier... modifiers)  
      java.nio.file.Path relativize​(java.nio.file.Path other)  
      java.nio.file.Path resolve​(java.lang.String other)  
      java.nio.file.Path resolve​(java.nio.file.Path other)  
      java.nio.file.Path resolveSibling​(java.lang.String other)  
      java.nio.file.Path resolveSibling​(java.nio.file.Path other)  
      boolean startsWith​(java.lang.String other)  
      boolean startsWith​(java.nio.file.Path other)  
      java.nio.file.Path subpath​(int beginIndex, int endIndex)  
      java.nio.file.Path toAbsolutePath()  
      java.io.File toFile()  
      java.nio.file.Path toRealPath​(java.nio.file.LinkOption... options)  
      java.lang.String toString()  
      java.net.URI toUri()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
      • Methods inherited from interface java.nio.file.Path

        equals, hashCode
    • Field Detail

      • path

        private final java.lang.String path
      • fs

        private final java.nio.file.FileSystem fs
    • Constructor Detail

      • MockPath

        public MockPath​(java.lang.String path)
    • Method Detail

      • getFileSystem

        public java.nio.file.FileSystem getFileSystem()
        Specified by:
        getFileSystem in interface java.nio.file.Path
      • isAbsolute

        public boolean isAbsolute()
        Specified by:
        isAbsolute in interface java.nio.file.Path
      • getRoot

        public java.nio.file.Path getRoot()
        Specified by:
        getRoot in interface java.nio.file.Path
      • getFileName

        public java.nio.file.Path getFileName()
        Specified by:
        getFileName in interface java.nio.file.Path
      • getParent

        public java.nio.file.Path getParent()
        Specified by:
        getParent in interface java.nio.file.Path
      • getNameCount

        public int getNameCount()
        Specified by:
        getNameCount in interface java.nio.file.Path
      • getName

        public java.nio.file.Path getName​(int index)
        Specified by:
        getName in interface java.nio.file.Path
      • subpath

        public java.nio.file.Path subpath​(int beginIndex,
                                          int endIndex)
        Specified by:
        subpath in interface java.nio.file.Path
      • startsWith

        public boolean startsWith​(java.nio.file.Path other)
        Specified by:
        startsWith in interface java.nio.file.Path
      • startsWith

        public boolean startsWith​(java.lang.String other)
        Specified by:
        startsWith in interface java.nio.file.Path
      • endsWith

        public boolean endsWith​(java.nio.file.Path other)
        Specified by:
        endsWith in interface java.nio.file.Path
      • endsWith

        public boolean endsWith​(java.lang.String other)
        Specified by:
        endsWith in interface java.nio.file.Path
      • normalize

        public java.nio.file.Path normalize()
        Specified by:
        normalize in interface java.nio.file.Path
      • resolve

        public java.nio.file.Path resolve​(java.nio.file.Path other)
        Specified by:
        resolve in interface java.nio.file.Path
      • resolve

        public java.nio.file.Path resolve​(java.lang.String other)
        Specified by:
        resolve in interface java.nio.file.Path
      • resolveSibling

        public java.nio.file.Path resolveSibling​(java.nio.file.Path other)
        Specified by:
        resolveSibling in interface java.nio.file.Path
      • resolveSibling

        public java.nio.file.Path resolveSibling​(java.lang.String other)
        Specified by:
        resolveSibling in interface java.nio.file.Path
      • relativize

        public java.nio.file.Path relativize​(java.nio.file.Path other)
        Specified by:
        relativize in interface java.nio.file.Path
      • toUri

        public java.net.URI toUri()
        Specified by:
        toUri in interface java.nio.file.Path
      • toAbsolutePath

        public java.nio.file.Path toAbsolutePath()
        Specified by:
        toAbsolutePath in interface java.nio.file.Path
      • toRealPath

        public java.nio.file.Path toRealPath​(java.nio.file.LinkOption... options)
                                      throws java.io.IOException
        Specified by:
        toRealPath in interface java.nio.file.Path
        Throws:
        java.io.IOException
      • toFile

        public java.io.File toFile()
        Specified by:
        toFile in interface java.nio.file.Path
      • register

        public java.nio.file.WatchKey register​(java.nio.file.WatchService watcher,
                                               java.nio.file.WatchEvent.Kind<?>... events)
                                        throws java.io.IOException
        Specified by:
        register in interface java.nio.file.Path
        Specified by:
        register in interface java.nio.file.Watchable
        Throws:
        java.io.IOException
      • register

        public java.nio.file.WatchKey register​(java.nio.file.WatchService watcher,
                                               java.nio.file.WatchEvent.Kind<?>[] events,
                                               java.nio.file.WatchEvent.Modifier... modifiers)
                                        throws java.io.IOException
        Specified by:
        register in interface java.nio.file.Path
        Specified by:
        register in interface java.nio.file.Watchable
        Throws:
        java.io.IOException
      • iterator

        public java.util.Iterator<java.nio.file.Path> iterator()
        Specified by:
        iterator in interface java.lang.Iterable<java.nio.file.Path>
        Specified by:
        iterator in interface java.nio.file.Path
      • compareTo

        public int compareTo​(java.nio.file.Path other)
        Specified by:
        compareTo in interface java.lang.Comparable<java.nio.file.Path>
        Specified by:
        compareTo in interface java.nio.file.Path
      • toString

        public java.lang.String toString()
        Specified by:
        toString in interface java.nio.file.Path
        Overrides:
        toString in class java.lang.Object