org.apache.lucene.mockfile

## Class FilterPath

- java.lang.Object
- - org.apache.lucene.mockfile.FilterPath

- All Implemented Interfaces:
    Comparable<Path>, Iterable<Path>, Path, Watchable

      public class FilterPath
      extends Object
      implements Path

  A `FilterPath` contains another `Path`, which it uses as its basic source of data, possibly transforming the data along the way or providing additional functionality.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected Path` | `delegate` The underlying `Path` instance.
    `protected FileSystem` | `fileSystem` The parent `FileSystem` for this path.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `FilterPath(Path delegate, FileSystem fileSystem)` Construct a `FilterPath` with parent `fileSystem`, based on the specified base path.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `compareTo(Path other)`
    `boolean` | `endsWith(Path other)`
    `boolean` | `endsWith(String other)`
    `boolean` | `equals(Object obj)`
    `Path` | `getDelegate()` Get the underlying wrapped path.
    `Path` | `getFileName()`
    `FileSystem` | `getFileSystem()`
    `Path` | `getName(int index)`
    `int` | `getNameCount()`
    `Path` | `getParent()`
    `Path` | `getRoot()`
    `int` | `hashCode()`
    `boolean` | `isAbsolute()`
    `Iterator<Path>` | `iterator()`
    `Path` | `normalize()`
    `WatchKey` | `register(WatchService watcher, WatchEvent.Kind<?>... events)`
    `WatchKey` | `register(WatchService watcher, WatchEvent.Kind<?>[] events, WatchEvent.Modifier... modifiers)`
    `Path` | `relativize(Path other)`
    `Path` | `resolve(Path other)`
    `Path` | `resolve(String other)`
    `Path` | `resolveSibling(Path other)`
    `Path` | `resolveSibling(String other)`
    `boolean` | `startsWith(Path other)`
    `boolean` | `startsWith(String other)`
    `Path` | `subpath(int beginIndex, int endIndex)`
    `Path` | `toAbsolutePath()`
    `protected Path` | `toDelegate(Path path)` Override this to customize the unboxing of Path from various operations
    `File` | `toFile()`
    `Path` | `toRealPath(LinkOption... options)`
    `String` | `toString()`
    `URI` | `toUri()`
    `static Path` | `unwrap(Path path)` Unwraps all `FilterPath`s, returning the innermost `Path`.
    `protected Path` | `wrap(Path other)` Override this to customize the return wrapped path from various operations

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface java.lang.Iterable

      `forEach, spliterator`

- - ### Field Detail

    - #### delegate

          protected final Path delegate

      The underlying `Path` instance.

    - #### fileSystem

          protected final FileSystem fileSystem

      The parent `FileSystem` for this path.

  - ### Constructor Detail

    - #### FilterPath

          public FilterPath(Path delegate,
                            FileSystem fileSystem)

      Construct a `FilterPath` with parent `fileSystem`, based on the specified base path.
      Parameters:
        `delegate` - specified base path.
        `fileSystem` - parent fileSystem.

  - ### Method Detail

    - #### getDelegate

          public Path getDelegate()

      Get the underlying wrapped path.
      Returns:
        wrapped path.

    - #### getFileSystem

          public FileSystem getFileSystem()

      Specified by:
        `getFileSystem` in interface `Path`

    - #### isAbsolute

          public boolean isAbsolute()

      Specified by:
        `isAbsolute` in interface `Path`

    - #### getRoot

          public Path getRoot()

      Specified by:
        `getRoot` in interface `Path`

    - #### getFileName

          public Path getFileName()

      Specified by:
        `getFileName` in interface `Path`

    - #### getParent

          public Path getParent()

      Specified by:
        `getParent` in interface `Path`

    - #### getNameCount

          public int getNameCount()

      Specified by:
        `getNameCount` in interface `Path`

    - #### getName

          public Path getName(int index)

      Specified by:
        `getName` in interface `Path`

    - #### subpath

          public Path subpath(int beginIndex,
                              int endIndex)

      Specified by:
        `subpath` in interface `Path`

    - #### startsWith

          public boolean startsWith(Path other)

      Specified by:
        `startsWith` in interface `Path`

    - #### startsWith

          public boolean startsWith(String other)

      Specified by:
        `startsWith` in interface `Path`

    - #### endsWith

          public boolean endsWith(Path other)

      Specified by:
        `endsWith` in interface `Path`

    - #### endsWith

          public boolean endsWith(String other)

      Specified by:
        `endsWith` in interface `Path`

    - #### normalize

          public Path normalize()

      Specified by:
        `normalize` in interface `Path`

    - #### resolve

          public Path resolve(Path other)

      Specified by:
        `resolve` in interface `Path`

    - #### resolve

          public Path resolve(String other)

      Specified by:
        `resolve` in interface `Path`

    - #### resolveSibling

          public Path resolveSibling(Path other)

      Specified by:
        `resolveSibling` in interface `Path`

    - #### resolveSibling

          public Path resolveSibling(String other)

      Specified by:
        `resolveSibling` in interface `Path`

    - #### relativize

          public Path relativize(Path other)

      Specified by:
        `relativize` in interface `Path`

    - #### toUri

          public URI toUri()

      Specified by:
        `toUri` in interface `Path`

    - #### toString

          public String toString()

      Specified by:
        `toString` in interface `Path`
      Overrides:
        `toString` in class `Object`

    - #### toAbsolutePath

          public Path toAbsolutePath()

      Specified by:
        `toAbsolutePath` in interface `Path`

    - #### toRealPath

          public Path toRealPath(LinkOption... options)
                          throws IOException

      Specified by:
        `toRealPath` in interface `Path`
      Throws:
        `IOException`

    - #### toFile

          public File toFile()

      Specified by:
        `toFile` in interface `Path`

    - #### register

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

      Specified by:
        `register` in interface `Path`
      Specified by:
        `register` in interface `Watchable`
      Throws:
        `IOException`

    - #### register

          public WatchKey register(WatchService watcher,
                                   WatchEvent.Kind<?>... events)
                            throws IOException

      Specified by:
        `register` in interface `Path`
      Specified by:
        `register` in interface `Watchable`
      Throws:
        `IOException`

    - #### iterator

          public Iterator<Path> iterator()

      Specified by:
        `iterator` in interface `Iterable<Path>`
      Specified by:
        `iterator` in interface `Path`

    - #### compareTo

          public int compareTo(Path other)

      Specified by:
        `compareTo` in interface `Comparable<Path>`
      Specified by:
        `compareTo` in interface `Path`

    - #### hashCode

          public int hashCode()

      Specified by:
        `hashCode` in interface `Path`
      Overrides:
        `hashCode` in class `Object`

    - #### equals

          public boolean equals(Object obj)

      Specified by:
        `equals` in interface `Path`
      Overrides:
        `equals` in class `Object`

    - #### unwrap

          public static Path unwrap(Path path)

      Unwraps all `FilterPath`s, returning the innermost `Path`.

      WARNING: this is exposed for testing only!

      Parameters:
        `path` - specified path.
      Returns:
        innermost Path instance

    - #### wrap

          protected Path wrap(Path other)

      Override this to customize the return wrapped path from various operations

    - #### toDelegate

          protected Path toDelegate(Path path)

      Override this to customize the unboxing of Path from various operations

Copyright © 2000-2018 Apache Software Foundation. All Rights Reserved.