Package ghidra.formats.gfilesystem
Class GFileLocal
- java.lang.Object
-
- ghidra.formats.gfilesystem.GFileLocal
-
- All Implemented Interfaces:
GFile
public class GFileLocal extends java.lang.Object implements GFile
GFileimplementation 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 Summary
Constructors Constructor Description GFileLocal(java.io.File f, java.lang.String path, FSRL fsrl, GFileSystem fs, GFile parent)Create new GFileLocal instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GFileSystemgetFilesystem()TheGFileSystemthat owns this file.FSRLgetFSRL()TheFSRLof this file.longgetLastModified()longgetLength()Returns the length of this file, or -1 if not known.java.io.FilegetLocalFile()java.lang.StringgetName()The name of this file.GFilegetParentFile()The parent directory of this file.java.lang.StringgetPath()The path and filename of this file, relative to its owning filesystem.booleanisDirectory()Returns true if this is a directory.java.lang.StringtoString()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface ghidra.formats.gfilesystem.GFile
getListing
-
-
-
-
Constructor Detail
-
GFileLocal
public GFileLocal(java.io.File f, java.lang.String path, FSRL fsrl, GFileSystem fs, GFile parent)Create new GFileLocal instance.- Parameters:
f-Fileon the local filesystempath- String path (including filename) of this instancefsrl-FSRLof this instancefs-GFileSystemthat created this file.parent- Parent directory that contains this file, or null if parent is root.
-
-
Method Detail
-
getFilesystem
public GFileSystem getFilesystem()
Description copied from interface:GFileTheGFileSystemthat owns this file.- Specified by:
getFilesystemin interfaceGFile- Returns:
GFileSystemthat owns this file.
-
getParentFile
public GFile getParentFile()
Description copied from interface:GFileThe parent directory of this file.- Specified by:
getParentFilein interfaceGFile- Returns:
- parent
GFiledirectory of this file.
-
getPath
public java.lang.String getPath()
Description copied from interface:GFileThe path and filename of this file, relative to its owning filesystem.
-
getName
public java.lang.String getName()
Description copied from interface:GFileThe name of this file.
-
isDirectory
public boolean isDirectory()
Description copied from interface:GFileReturns true if this is a directory.- Specified by:
isDirectoryin interfaceGFile- Returns:
- boolean true if this file is a directory, false otherwise.
-
getLength
public long getLength()
Description copied from interface:GFileReturns the length of this file, or -1 if not known.
-
getLastModified
public long getLastModified()
- Specified by:
getLastModifiedin interfaceGFile
-
getLocalFile
public java.io.File getLocalFile()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-