org.apache.lucene.mockfile

## Class WindowsFS

- java.lang.Object
- - java.nio.file.spi.FileSystemProvider
  - - org.apache.lucene.mockfile.FilterFileSystemProvider
    - - org.apache.lucene.mockfile.HandleTrackingFS
      - - org.apache.lucene.mockfile.WindowsFS

-     public class WindowsFS
      extends HandleTrackingFS

  FileSystem that (imperfectly) acts like windows.

  Currently this filesystem only prevents deletion of open files.

- - ### Field Summary

    - ### Fields inherited from class org.apache.lucene.mockfile.FilterFileSystemProvider

      `delegate, fileSystem, scheme`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `WindowsFS(FileSystem delegate)` Create a new instance, wrapping the delegate filesystem to act like Windows.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `delete(Path path)`
    `boolean` | `deleteIfExists(Path path)`
    `void` | `move(Path source, Path target, CopyOption... options)`
    `protected void` | `onClose(Path path, Object stream)` Called when `path` is closed via `stream`.
    `protected void` | `onOpen(Path path, Object stream)` Called when `path` is opened via `stream`.

    - ### Methods inherited from class org.apache.lucene.mockfile.HandleTrackingFS

      `newAsynchronousFileChannel, newByteChannel, newDirectoryStream, newFileChannel, newInputStream, newOutputStream`

    - ### Methods inherited from class org.apache.lucene.mockfile.FilterFileSystemProvider

      `checkAccess, copy, createDirectory, createLink, createSymbolicLink, getFileAttributeView, getFileStore, getFileSystem, getPath, getScheme, isHidden, isSameFile, newFileSystem, newFileSystem, onClose, readAttributes, readAttributes, readSymbolicLink, setAttribute, toDelegate, toString`

    - ### Methods inherited from class java.nio.file.spi.FileSystemProvider

      `installedProviders`

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

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

- - ### Constructor Detail

    - #### WindowsFS

          public WindowsFS(FileSystem delegate)

      Create a new instance, wrapping the delegate filesystem to act like Windows.
      Parameters:
        `delegate` - delegate filesystem to wrap.

  - ### Method Detail

    - #### onOpen

          protected void onOpen(Path path,
                                Object stream)
                         throws IOException

      Description copied from class: `HandleTrackingFS`
      Called when `path` is opened via `stream`.
      Specified by:
        `onOpen` in class `HandleTrackingFS`
      Parameters:
        `path` - Path that was opened
        `stream` - Stream or Channel opened against the path.
      Throws:
        `IOException` - if an I/O error occurs.

    - #### onClose

          protected void onClose(Path path,
                                 Object stream)
                          throws IOException

      Description copied from class: `HandleTrackingFS`
      Called when `path` is closed via `stream`.
      Specified by:
        `onClose` in class `HandleTrackingFS`
      Parameters:
        `path` - Path that was closed
        `stream` - Stream or Channel closed against the path.
      Throws:
        `IOException` - if an I/O error occurs.

    - #### delete

          public void delete(Path path)
                      throws IOException

      Overrides:
        `delete` in class `FilterFileSystemProvider`
      Throws:
        `IOException`

    - #### move

          public void move(Path source,
                           Path target,
                           CopyOption... options)
                    throws IOException

      Overrides:
        `move` in class `FilterFileSystemProvider`
      Throws:
        `IOException`

    - #### deleteIfExists

          public boolean deleteIfExists(Path path)
                                 throws IOException

      Overrides:
        `deleteIfExists` in class `FilterFileSystemProvider`
      Throws:
        `IOException`

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