Class Path

  • All Implemented Interfaces:
    Watchable
    Direct Known Subclasses:
    PathImpl

    public abstract class Path
    extends java.lang.Object
    implements Watchable
    This class represents an abstract Path object that a WatchService can operate on.
    Note that Path is a new way of representing file system paths in JDK7 and is included here to provide source level compatibility. This implementation only uses it as a wrapper for java.io.File.
    To create a new Path instance, either use the Bootstrapper.newPath() or Paths.
    • Constructor Detail

      • Path

        protected Path()
    • Method Detail

      • equals

        public abstract boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public abstract int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • register

        public abstract WatchKey register​(WatchService watcher,
                                          WatchEvent.Kind<?>... events)
                                   throws java.io.IOException
        Description copied from interface: Watchable
        Registers the file system path (a directory) with the given WatchService and provides a WatchKey as a handle for that registration. Equivalent to calling register(watcher, events, new WatchEvent.Modifier[0]);
        Specified by:
        register in interface Watchable
        Throws:
        java.io.IOException
        See Also:
        Path#register(name.pachler.nio.file.WatchService, name.pachler.nio.file.WatchEvent.Kind[], name.pachler.nio.file.WatchEvent.Modifier[])
      • resolve

        public abstract Path resolve​(Path other)
      • toString

        public abstract java.lang.String toString()
        Overrides:
        toString in class java.lang.Object