org.apache.lucene.mockfile

## Class FilterDirectoryStream

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

- All Implemented Interfaces:
    Closeable, AutoCloseable, Iterable<Path>, DirectoryStream<Path>

      public class FilterDirectoryStream
      extends Object
      implements DirectoryStream<Path>

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

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface java.nio.file.DirectoryStream

      `DirectoryStream.Filter<T>`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected DirectoryStream<Path>` | `delegate` The underlying `DirectoryStream` instance.
    `protected FileSystem` | `fileSystem` The underlying `FileSystem` instance.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `FilterDirectoryStream(DirectoryStream<Path> delegate, FileSystem fileSystem)` Construct a `FilterDirectoryStream` based on the specified base stream.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()`
    `Iterator<Path>` | `iterator()`

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

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

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

      `forEach, spliterator`

- - ### Field Detail

    - #### delegate

          protected final DirectoryStream<Path> delegate

      The underlying `DirectoryStream` instance.

    - #### fileSystem

          protected final FileSystem fileSystem

      The underlying `FileSystem` instance.

  - ### Constructor Detail

    - #### FilterDirectoryStream

          public FilterDirectoryStream(DirectoryStream<Path> delegate,
                                       FileSystem fileSystem)

      Construct a `FilterDirectoryStream` based on the specified base stream.

      Note that base stream is closed if this stream is closed.

      Parameters:
        `delegate` - specified base stream.

  - ### Method Detail

    - #### close

          public void close()
                     throws IOException

      Specified by:
        `close` in interface `Closeable`
      Specified by:
        `close` in interface `AutoCloseable`
      Throws:
        `IOException`

    - #### iterator

          public Iterator<Path> iterator()

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

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