Package: org.apache.groovy.nio.runtime

## [Java] Class WritablePath

- org.apache.groovy.nio.runtime.WritablePath

- All Implemented Interfaces and Traits:
    Path, Writable

      public class WritablePath
      extends Object
      implements Path, Writable

  Path wrapper that also implements Writable.

  All `Path` operations are delegated to the wrapped path, while writeTo(Writer) streams the path contents using the configured character encoding when one is supplied.

- - ### Constructor Summary

    Constructors
    Constructor and description
    `WritablePath(Path delegate)` Creates a writable wrapper that uses the platform default charset when reading the path contents.
    `WritablePath(Path delegate, String encoding)` Creates a writable wrapper for the supplied path.

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public int` | `compareTo(Path other)` {@inheritDoc}
    `` | `public boolean` | `endsWith(Path other)` {@inheritDoc}
    `` | `public boolean` | `endsWith(String other)` {@inheritDoc}
    `` | `public boolean` | `equals(Object other)` {@inheritDoc}
    `` | `public Path` | `getFileName()` {@inheritDoc}
    `` | `public FileSystem` | `getFileSystem()` {@inheritDoc}
    `` | `public Path` | `getName(int index)` {@inheritDoc}
    `` | `public int` | `getNameCount()` {@inheritDoc}
    `` | `public Path` | `getParent()` {@inheritDoc}
    `` | `public Path` | `getRoot()` {@inheritDoc}
    `` | `public int` | `hashCode()` {@inheritDoc}
    `` | `public boolean` | `isAbsolute()` {@inheritDoc}
    `` | `public Iterator<Path>` | `iterator()` {@inheritDoc}
    `` | `public Path` | `normalize()` {@inheritDoc}
    `` | `public WatchKey` | `register(WatchService watcher, WatchEvent.Kind<?>[] events, WatchEvent.Modifier modifiers)` {@inheritDoc}
    `` | `public WatchKey` | `register(WatchService watcher, WatchEvent.Kind<?> events)` {@inheritDoc}
    `` | `public Path` | `relativize(Path other)` {@inheritDoc}
    `` | `public Path` | `resolve(Path other)` {@inheritDoc}
    `` | `public Path` | `resolve(String other)` {@inheritDoc}
    `` | `public Path` | `resolveSibling(Path other)` {@inheritDoc}
    `` | `public Path` | `resolveSibling(String other)` {@inheritDoc}
    `` | `public boolean` | `startsWith(Path other)` {@inheritDoc}
    `` | `public boolean` | `startsWith(String other)` {@inheritDoc}
    `` | `public Path` | `subpath(int beginIndex, int endIndex)` {@inheritDoc}
    `` | `public Path` | `toAbsolutePath()` {@inheritDoc}
    `` | `public File` | `toFile()` {@inheritDoc}
    `` | `public Path` | `toRealPath(LinkOption options)` {@inheritDoc}
    `` | `public String` | `toString()` {@inheritDoc}
    `` | `public URI` | `toUri()` {@inheritDoc}
    `` | `public Writer` | `writeTo(Writer out)` Writes the wrapped path contents to the supplied writer.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Object` | `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### public WritablePath(Path delegate)

      Creates a writable wrapper that uses the platform default charset when reading the path contents.

      Parameters:
        `delegate` - the path to wrap

    - #### public WritablePath(Path delegate, String encoding)

      Creates a writable wrapper for the supplied path.

      Parameters:
        `delegate` - the path to wrap
        `encoding` - the charset name to use when reading path contents; `null` uses the platform default charset

  - ### Method Detail

    - #### public int compareTo(Path other)

      {@inheritDoc}

    - #### public boolean endsWith(Path other)

      {@inheritDoc}

    - #### public boolean endsWith(String other)

      {@inheritDoc}

    - #### public boolean equals(Object other)

      {@inheritDoc}

    - #### public Path getFileName()

      {@inheritDoc}

    - #### public FileSystem getFileSystem()

      {@inheritDoc}

    - #### public Path getName(int index)

      {@inheritDoc}

    - #### public int getNameCount()

      {@inheritDoc}

    - #### public Path getParent()

      {@inheritDoc}

    - #### public Path getRoot()

      {@inheritDoc}

    - #### public int hashCode()

      {@inheritDoc}

    - #### public boolean isAbsolute()

      {@inheritDoc}

    - #### public Iterator<Path> iterator()

      {@inheritDoc}

    - #### public Path normalize()

      {@inheritDoc}

    - #### public WatchKey register(WatchService watcher, WatchEvent.Kind<?>[] events, WatchEvent.Modifier modifiers)

      {@inheritDoc}

    - #### public WatchKey register(WatchService watcher, WatchEvent.Kind<?> events)

      {@inheritDoc}

    - #### public Path relativize(Path other)

      {@inheritDoc}

    - #### public Path resolve(Path other)

      {@inheritDoc}

    - #### public Path resolve(String other)

      {@inheritDoc}

    - #### public Path resolveSibling(Path other)

      {@inheritDoc}

    - #### public Path resolveSibling(String other)

      {@inheritDoc}

    - #### public boolean startsWith(Path other)

      {@inheritDoc}

    - #### public boolean startsWith(String other)

      {@inheritDoc}

    - #### public Path subpath(int beginIndex, int endIndex)

      {@inheritDoc}

    - #### public Path toAbsolutePath()

      {@inheritDoc}

    - #### public File toFile()

      {@inheritDoc}

    - #### public Path toRealPath(LinkOption options)

      {@inheritDoc}

    - #### public String toString()

      {@inheritDoc}

    - #### public URI toUri()

      {@inheritDoc}

    - #### public Writer writeTo(Writer out)

      Writes the wrapped path contents to the supplied writer.

      throws:
        IOException if the path cannot be read or the writer cannot be updated
      Parameters:
        `out` - the destination writer
      Returns:
        the supplied writer