Package ghidra.formats.gfilesystem
Class AbstractFileSystem<METADATATYPE>
java.lang.Object
ghidra.formats.gfilesystem.AbstractFileSystem<METADATATYPE>
- Type Parameters:
METADATATYPE- the type of objects that will be stored in the FileSystemIndexHelper
- All Implemented Interfaces:
GFileSystem,ExtensionPoint,Closeable,AutoCloseable
Default implementation of base file system functionality.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final FSRLRootprotected FileSystemIndexHelper<METADATATYPE>protected final FileSystemServiceprotected FileSystemRefManager -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractFileSystem(FSRLRoot fsFSRL, FileSystemService fsService) Initializes the fields for this abstract implementation of a file system. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the number of files in the filesystem, if known, otherwise -1 if not known.protected Comparator<String>getFSRL()File system's FSRLgetListing(GFile directory) Returns a list offilesthat reside in the specified directory on this filesystem.getName()File system volume name.Returns theref managerthat is responsible for creating and releasingrefsto this filesystem.Retrieves aGFilefrom this filesystem based on its full path and filename, using this filesystem's default name comparison logic (eg.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ghidra.formats.gfilesystem.GFileSystem
getByteProvider, getDescription, getFileAttributes, getInputStream, getType, isClosed, isStatic
-
Field Details
-
fsService
-
fsFSRL
-
fsIndex
-
refManager
-
-
Constructor Details
-
AbstractFileSystem
Initializes the fields for this abstract implementation of a file system.- Parameters:
fsFSRL-FSRLRootof this file systemfsService- reference to theFileSystemServiceinstance
-
-
Method Details
-
getName
Description copied from interface:GFileSystemFile system volume name.Typically the name of the container file, or a internally stored 'volume' name.
- Specified by:
getNamein interfaceGFileSystem- Returns:
- string filesystem volume name.
-
getFSRL
Description copied from interface:GFileSystemFile system's FSRL- Specified by:
getFSRLin interfaceGFileSystem- Returns:
FSRLRootof this filesystem.
-
getRefManager
Description copied from interface:GFileSystemReturns theref managerthat is responsible for creating and releasingrefsto this filesystem.- Specified by:
getRefManagerin interfaceGFileSystem- Returns:
FileSystemRefManagerthat manages references to this filesystem.
-
getFilenameComparator
-
lookup
Description copied from interface:GFileSystemRetrieves aGFilefrom this filesystem based on its full path and filename, using this filesystem's default name comparison logic (eg. case sensitive vs insensitive).- Specified by:
lookupin interfaceGFileSystem- Parameters:
path- string path and filename of a file located in this filesystem. Usenullor "/" to retrieve the root directory- Returns:
GFileinstance of requested file, null if not found.
-
getListing
Description copied from interface:GFileSystemReturns a list offilesthat reside in the specified directory on this filesystem.- Specified by:
getListingin interfaceGFileSystem- Parameters:
directory- NULL means root of filesystem.- Returns:
ListofGFileinstances of file in the requested directory.
-
getFileCount
public int getFileCount()Description copied from interface:GFileSystemReturns the number of files in the filesystem, if known, otherwise -1 if not known.- Specified by:
getFileCountin interfaceGFileSystem- Returns:
- number of files in this filesystem, -1 if not known.
-