Class GFileSystemBaseFactory
- java.lang.Object
- 
- ghidra.formats.gfilesystem.factory.GFileSystemBaseFactory
 
- 
- All Implemented Interfaces:
- GFileSystemFactory<GFileSystemBase>,- GFileSystemFactoryByteProvider<GFileSystemBase>,- GFileSystemProbe,- GFileSystemProbeByteProvider
 
 public class GFileSystemBaseFactory extends java.lang.Object implements GFileSystemFactoryByteProvider<GFileSystemBase>, GFileSystemProbeByteProvider AGFileSystemFactoryimplementation that probes and creates instances ofGFileSystemBasewhich use the legacy filesystem lifecycle pattern.For each operation, this factory will mint a new instance of a GFileSystemBase-derived fs, using its 3 param constructor, and call its isValid() or open(). After an isValid() call, the newly minted filesystem instance is thrown away. This class requires special support in the FileSystemFactoryMgrto push the fsClass into each factory instance after it is constructed.
- 
- 
Constructor SummaryConstructors Constructor Description GFileSystemBaseFactory()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description GFileSystemBasecreate(FSRLRoot targetFSRL, ByteProvider byteProvider, FileSystemService fsService, TaskMonitor monitor)Constructs a newGFileSysteminstance that handles the specified file.booleanprobe(ByteProvider byteProvider, FileSystemService fsService, TaskMonitor monitor)Probes the specifiedByteProviderto determine if this filesystem implementation can handle the file.voidsetFileSystemClass(java.lang.Class<? extends GFileSystemBase> fsClass)
 
- 
- 
- 
Method Detail- 
setFileSystemClasspublic void setFileSystemClass(java.lang.Class<? extends GFileSystemBase> fsClass) 
 - 
probepublic boolean probe(ByteProvider byteProvider, FileSystemService fsService, TaskMonitor monitor) throws java.io.IOException, CancelledException Description copied from interface:GFileSystemProbeByteProviderProbes the specifiedByteProviderto determine if this filesystem implementation can handle the file.- Specified by:
- probein interface- GFileSystemProbeByteProvider
- Parameters:
- byteProvider- a- ByteProvidercontaining the contents of the file being probed. Implementors of this method should NOT- close()this object.
- fsService- a reference to the- FileSystemServiceobject
- monitor- a- TaskMonitorthat should be polled to see if the user has requested to cancel the operation, and updated with progress information.
- Returns:
- trueif the specified file is handled by this filesystem implementation,- falseif not.
- Throws:
- java.io.IOException- if there is an error reading files.
- CancelledException- if the user cancels
 
 - 
createpublic GFileSystemBase create(FSRLRoot targetFSRL, ByteProvider byteProvider, FileSystemService fsService, TaskMonitor monitor) throws java.io.IOException, CancelledException Description copied from interface:GFileSystemFactoryByteProviderConstructs a newGFileSysteminstance that handles the specified file.- Specified by:
- createin interface- GFileSystemFactoryByteProvider<GFileSystemBase>
- Parameters:
- targetFSRL- the- FSRLRootof the filesystem being created.
- byteProvider- a- ByteProvidercontaining the contents of the file being probed. This method is responsible for closing this byte provider instance.
- fsService- a reference to the- FileSystemServiceobject
- monitor- a- TaskMonitorthat should be polled to see if the user has requested to cancel the operation, and updated with progress information.
- Returns:
- a new GFileSystemderived instance.
- Throws:
- java.io.IOException- if there is an error reading files.
- CancelledException- if the user cancels
 
 
- 
 
-