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
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 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 GFileSystem
getFilesystem()
TheGFileSystem
that owns this file.FSRL
getFSRL()
TheFSRL
of this file.long
getLastModified()
long
getLength()
Returns the length of this file, or -1 if not known.java.io.File
getLocalFile()
java.lang.String
getName()
The name of this file.GFile
getParentFile()
The parent directory of this file.java.lang.String
getPath()
The path and filename of this file, relative to its owning filesystem.boolean
isDirectory()
Returns true if this is a directory.java.lang.String
toString()
-
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
-File
on the local filesystempath
- String path (including filename) of this instancefsrl
-FSRL
of this instancefs
-GFileSystem
that 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:GFile
TheGFileSystem
that owns this file.- Specified by:
getFilesystem
in interfaceGFile
- Returns:
GFileSystem
that owns this file.
-
getParentFile
public GFile getParentFile()
Description copied from interface:GFile
The parent directory of this file.- Specified by:
getParentFile
in interfaceGFile
- Returns:
- parent
GFile
directory of this file.
-
getPath
public java.lang.String getPath()
Description copied from interface:GFile
The path and filename of this file, relative to its owning filesystem.
-
getName
public java.lang.String getName()
Description copied from interface:GFile
The name of this file.
-
isDirectory
public boolean isDirectory()
Description copied from interface:GFile
Returns true if this is a directory.- Specified by:
isDirectory
in interfaceGFile
- 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.
-
getLastModified
public long getLastModified()
- Specified by:
getLastModified
in interfaceGFile
-
getLocalFile
public java.io.File getLocalFile()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-