Interface FileSystem<T extends FileHandle>

All Superinterfaces:
AutoCloseable, Closeable

public interface FileSystem<T extends FileHandle> extends Closeable
Interface representing a filesystem and providing means to operate on file handles.
Since:
4.0
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Path separator String.
    static final char
    Path separator char.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Close file system.
    Releases any resources associated with this file system.
    obtain(@Nullable String path)
    Obtain a handle to the file or directory with the given path.
  • Field Details

    • SEPARATOR

      static final String SEPARATOR
      Path separator String.
      Since:
      4.0
      See Also:
    • SEPARATOR_CHAR

      static final char SEPARATOR_CHAR
      Path separator char.
      Since:
      4.0
  • Method Details

    • obtain

      @NotNull T obtain(@Nullable @Nullable String path) throws IOException
      Obtain a handle to the file or directory with the given path.

      If the given path is null or empty, the handle of the current working directory is returned.

      Parameters:
      path - The path to the file or directory.
      Returns:
      A FileHandle.
      Throws:
      IOException
      Since:
      4.0
    • close

      void close() throws IOException
      Close file system.
      Releases any resources associated with this file system. Do not use the file system after calling this method.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException
      Since:
      4.0