Interface GFile

All Known Implementing Classes:
GFileImpl, GFileLocal

public interface GFile
Represents a file in a filesystem.

Only valid while the owning filesystem object is still open and not closed.

  • Method Details

    • getFilesystem

      GFileSystem getFilesystem()
      The GFileSystem that owns this file.
      Returns:
      GFileSystem that owns this file.
    • getFSRL

      FSRL getFSRL()
      The FSRL of this file.
      Returns:
      FSRL of this file.
    • getParentFile

      GFile getParentFile()
      The parent directory of this file.
      Returns:
      parent GFile directory of this file.
    • getPath

      String getPath()
      The path and filename of this file, relative to its owning filesystem.
      Returns:
      path and filename of this file, relative to its owning filesystem.
    • getName

      String getName()
      The name of this file.
      Returns:
      name of this file.
    • isDirectory

      boolean isDirectory()
      Returns true if this is a directory.

      Returns:
      boolean true if this file is a directory, false otherwise.
    • getLength

      long getLength()
      Returns the length of this file, or -1 if not known.
      Returns:
      number of bytes in this file.
    • getListing

      default List<GFile> getListing() throws IOException
      Returns a listing of files in this sub-directory.

      Returns:
      List of GFile instances.
      Throws:
      IOException - if not a directory or error when accessing files.