Class GFileLocal

java.lang.Object
ghidra.formats.gfilesystem.GFileLocal
All Implemented Interfaces:
GFile

public class GFileLocal extends Object implements GFile
GFile implementation that refers to a real java.io.File on the local file system.

This implementation keeps track of the FSRL and GFile path separately so that they can be different, as is the case with LocalFileSystemSub files that have real FSRLs but fake relative paths.

  • Constructor Details

    • GFileLocal

      public GFileLocal(File f, String path, FSRL fsrl, GFileSystem fs, GFile parent)
      Create new GFileLocal instance.
      Parameters:
      f - File on the local filesystem
      path - String path (including filename) of this instance
      fsrl - FSRL of this instance
      fs - GFileSystem that created this file.
      parent - Parent directory that contains this file, or null if parent is root.
  • Method Details

    • getFilesystem

      public GFileSystem getFilesystem()
      Description copied from interface: GFile
      The GFileSystem that owns this file.
      Specified by:
      getFilesystem in interface GFile
      Returns:
      GFileSystem that owns this file.
    • getFSRL

      public FSRL getFSRL()
      Description copied from interface: GFile
      The FSRL of this file.
      Specified by:
      getFSRL in interface GFile
      Returns:
      FSRL of this file.
    • getParentFile

      public GFile getParentFile()
      Description copied from interface: GFile
      The parent directory of this file.
      Specified by:
      getParentFile in interface GFile
      Returns:
      parent GFile directory of this file.
    • getPath

      public String getPath()
      Description copied from interface: GFile
      The path and filename of this file, relative to its owning filesystem.
      Specified by:
      getPath in interface GFile
      Returns:
      path and filename of this file, relative to its owning filesystem.
    • getName

      public String getName()
      Description copied from interface: GFile
      The name of this file.
      Specified by:
      getName in interface GFile
      Returns:
      name of this file.
    • isDirectory

      public boolean isDirectory()
      Description copied from interface: GFile
      Returns true if this is a directory.

      Specified by:
      isDirectory in interface GFile
      Returns:
      boolean true if this file is a directory, false otherwise.
    • getLength

      public long getLength()
      Description copied from interface: GFile
      Returns the length of this file, or -1 if not known.
      Specified by:
      getLength in interface GFile
      Returns:
      number of bytes in this file.
    • getLocalFile

      public File getLocalFile()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object