Class GFileImpl
- java.lang.Object
- 
- ghidra.formats.gfilesystem.GFileImpl
 
- 
- All Implemented Interfaces:
- GFile
 
 public class GFileImpl extends java.lang.Object implements GFile Base implementation of file in afilesystem.Only valid while the owning filesystem object is still open and not closed.See GFile.
- 
- 
Constructor SummaryConstructors Modifier Constructor Description protectedGFileImpl(GFileSystem fileSystem, GFile parentFile, boolean isDirectory, long length, FSRL fsrl)Protected constructor, use static helper methods to create new instances.
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)static GFileImplfromFilename(GFileSystem fileSystem, GFile parent, java.lang.String filename, boolean isDirectory, long length, FSRL fsrl)Creates a GFile for a filesystem using a simple name (not a path) and as a child of the specified parent.static GFileImplfromFSRL(GFileSystem fileSystem, GFile parent, FSRL fsrl, boolean isDirectory, long length)Creates a GFile for a filesystem using the information in a FSRL as the file's name and as a child of the specified parent.static GFileImplfromPathString(GFileSystem fileSystem, GFile parent, java.lang.String path, FSRL fsrl, boolean isDirectory, long length)Creates a GFile for a specific owning filesystem using a string path (ie.static GFileImplfromPathString(GFileSystem fileSystem, java.lang.String path, FSRL fsrl, boolean isDirectory, long length)Creates a GFile for a filesystem using a string path (ie.GFileSystemgetFilesystem()TheGFileSystemthat owns this file.FSRLgetFSRL()TheFSRLof this file.longgetLength()Returns the length of this file, or -1 if not known.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.inthashCode()booleanisDirectory()Returns true if this is a directory.voidsetLength(long length)java.lang.StringtoString()- 
Methods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, wait
 - 
Methods inherited from interface ghidra.formats.gfilesystem.GFilegetLastModified, getListing
 
- 
 
- 
- 
- 
Constructor Detail- 
GFileImplprotected GFileImpl(GFileSystem fileSystem, GFile parentFile, boolean isDirectory, long length, FSRL fsrl) Protected constructor, use static helper methods to create new instances.Creates a new GFile instance without any name parsing. - Parameters:
- fileSystem- the- GFileSystemthat owns this file
- parentFile- the parent of the new GFile or null if child-of-root.
- isDirectory- boolean flag to indicate that this is a directory
- length- length of the file (use -1 if not know or specified).
- fsrl-- FSRLto assign to the file.
 
 
- 
 - 
Method Detail- 
fromPathStringpublic static GFileImpl fromPathString(GFileSystem fileSystem, java.lang.String path, FSRL fsrl, boolean isDirectory, long length) Creates a GFile for a filesystem using a string path (ie. "dir/subdir/filename"), with the path starting at the root of the filesystem.The parents of this GFile are created fresh from any directory names in the path string. It is better to use the fromFilename(GFileSystem, GFile, String, boolean, long, FSRL)method to create GFile instances if you can supply the parent value as that will allow reuse of the parent objects instead of duplicates of them being created for each file with the same parent path.- Parameters:
- fileSystem- the- GFileSystemthat owns this file
- path- forward slash '/' separated path and filename string.
- fsrl-- FSRLto assign to the file, NULL if an auto-created FSRL is ok.
- isDirectory- boolean flag to indicate that this is a directory
- length- length of the file (use -1 if not know or specified).
- Returns:
- a new GFileImpl
 
 - 
fromPathStringpublic static GFileImpl fromPathString(GFileSystem fileSystem, GFile parent, java.lang.String path, FSRL fsrl, boolean isDirectory, long length) Creates a GFile for a specific owning filesystem using a string path (ie. "dir/subdir/filename"), with the path starting at the suppliedparentdirectory.The parents of this GFile are created fresh from any directory names in the path string. It is better to use the fromFilename(GFileSystem, GFile, String, boolean, long, FSRL)method to create GFile instances if you can supply the parent value as that will allow reuse of the parent objects instead of duplicates of them being created for each file with the same parent path.- Parameters:
- fileSystem- the- GFileSystemthat owns this file
- parent- the parent of the new GFile or null if child-of-root.
- path- forward slash '/' separated path and filename string.
- fsrl-- FSRLto assign to the file, NULL if an auto-created FSRL is ok.
- isDirectory- boolean flag to indicate that this is a directory
- length- length of the file (use -1 if not know or specified).
- Returns:
- a new GFileImpl
 
 - 
fromFilenamepublic static GFileImpl fromFilename(GFileSystem fileSystem, GFile parent, java.lang.String filename, boolean isDirectory, long length, FSRL fsrl) Creates a GFile for a filesystem using a simple name (not a path) and as a child of the specified parent.The filename is accepted without checking or validation. - Parameters:
- fileSystem- the- GFileSystemthat owns this file
- parent- the parent of the new GFile or null if child-of-root.
- filename- the file's name, not used if FSRL param specified.
- isDirectory- boolean flag to indicate that this is a directory
- length- length of the file (use -1 if not know or specified).
- fsrl-- FSRLto assign to the file, NULL if an auto-created FSRL is ok.
- Returns:
- a new GFileImpl
 
 - 
fromFSRLpublic static GFileImpl fromFSRL(GFileSystem fileSystem, GFile parent, FSRL fsrl, boolean isDirectory, long length) Creates a GFile for a filesystem using the information in a FSRL as the file's name and as a child of the specified parent.- Parameters:
- fileSystem- the- GFileSystemthat owns this file
- parent- the parent of the new GFile or null if child-of-root.
- fsrl-- FSRLto assign to the file.
- isDirectory- boolean flag to indicate that this is a directory
- length- length of the file (use -1 if not know or specified).
- Returns:
- a new GFileImpl
 
 - 
getParentFilepublic GFile getParentFile() Description copied from interface:GFileThe parent directory of this file.- Specified by:
- getParentFilein interface- GFile
- Returns:
- parent GFiledirectory of this file.
 
 - 
getNamepublic java.lang.String getName() Description copied from interface:GFileThe name of this file.
 - 
isDirectorypublic boolean isDirectory() Description copied from interface:GFileReturns true if this is a directory.- Specified by:
- isDirectoryin interface- GFile
- Returns:
- boolean true if this file is a directory, false otherwise.
 
 - 
getLengthpublic long getLength() Description copied from interface:GFileReturns the length of this file, or -1 if not known.
 - 
getFilesystempublic GFileSystem getFilesystem() Description copied from interface:GFileTheGFileSystemthat owns this file.- Specified by:
- getFilesystemin interface- GFile
- Returns:
- GFileSystemthat owns this file.
 
 - 
toStringpublic java.lang.String toString() - Overrides:
- toStringin class- java.lang.Object
 
 - 
getPathpublic java.lang.String getPath() Description copied from interface:GFileThe path and filename of this file, relative to its owning filesystem.
 - 
setLengthpublic void setLength(long length) 
 - 
hashCodepublic int hashCode() - Overrides:
- hashCodein class- java.lang.Object
 
 - 
equalspublic boolean equals(java.lang.Object obj) - Overrides:
- equalsin class- java.lang.Object
 
 
- 
 
-