Package ghidra.framework.data
Class DBContentHandler
- java.lang.Object
-
- ghidra.framework.data.DBContentHandler
-
- All Implemented Interfaces:
ContentHandler
,ExtensionPoint
- Direct Known Subclasses:
DataTypeArchiveContentHandler
,ProgramContentHandler
public abstract class DBContentHandler extends java.lang.Object implements ContentHandler
DBContentHandler
provides an abstract ContentHandler for domain object content which is stored within a database file. This class provides helper methods for working with database files.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface ghidra.util.classfinder.ExtensionPoint
ExtensionPoint.Exclude, ExtensionPoint.Util
-
-
Field Summary
-
Fields inherited from interface ghidra.framework.data.ContentHandler
MISSING_CONTENT, UNKNOWN_CONTENT
-
-
Constructor Summary
Constructors Constructor Description DBContentHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected long
createFile(DomainObjectAdapterDB domainObj, java.lang.String contentType, FileSystem fs, java.lang.String path, java.lang.String name, TaskMonitor monitor)
Create a new database file from an open database handle.protected DBHandle
openAssociatedUserFile(java.lang.String associatedFileID, java.lang.String associatedContentType, FileSystem userfs, TaskMonitor monitor)
Open user data file associatedDbhvoid
removeUserDataFile(FolderItem associatedItem, FileSystem userfs)
Remove user data file associated with an existing folder item.void
saveUserDataFile(DomainObject domainObj, DBHandle userDbh, FileSystem userfs, TaskMonitor monitor)
Create user data file associated with existing content.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface ghidra.framework.data.ContentHandler
createFile, getChangeSet, getContentType, getContentTypeDisplayString, getDefaultToolName, getDomainObject, getDomainObjectClass, getIcon, getImmutableObject, getMergeManager, getReadOnlyObject, isPrivateContentType
-
-
-
-
Method Detail
-
createFile
protected final long createFile(DomainObjectAdapterDB domainObj, java.lang.String contentType, FileSystem fs, java.lang.String path, java.lang.String name, TaskMonitor monitor) throws InvalidNameException, CancelledException, java.io.IOException
Create a new database file from an open database handle. If fs is versioned, the resulting item is marked as checked-out within the versioned file-system. The specified domainObj will become associated with the newly created database.- Parameters:
domainObj
- domain objectcontentType
- the content typefs
- the domain object file systempath
- the path of the new filename
- the name of the new filemonitor
- the monitor that allows the user to cancel- Returns:
- checkout ID for new file
- Throws:
InvalidNameException
- if the name contains invalid charactersCancelledException
- if the user cancels the operationjava.io.IOException
- if an i/o error occurs
-
saveUserDataFile
public final void saveUserDataFile(DomainObject domainObj, DBHandle userDbh, FileSystem userfs, TaskMonitor monitor) throws CancelledException, java.io.IOException
Description copied from interface:ContentHandler
Create user data file associated with existing content. This facilitates the lazy creation of the user data file.- Specified by:
saveUserDataFile
in interfaceContentHandler
- Parameters:
domainObj
- associated domain object corresponding to this content handleruserDbh
- user data handleuserfs
- private user data filesystemmonitor
- task monitor- Throws:
CancelledException
- if operation is cancelled by userjava.io.IOException
- if an access error occurs- See Also:
ContentHandler.saveUserDataFile(ghidra.framework.model.DomainObject, db.DBHandle, ghidra.framework.store.FileSystem, ghidra.util.task.TaskMonitor)
-
removeUserDataFile
public final void removeUserDataFile(FolderItem associatedItem, FileSystem userfs) throws java.io.IOException
Description copied from interface:ContentHandler
Remove user data file associated with an existing folder item.- Specified by:
removeUserDataFile
in interfaceContentHandler
- Parameters:
associatedItem
- folder item- Throws:
java.io.IOException
- if an access error occurs- See Also:
ContentHandler.removeUserDataFile(ghidra.framework.store.FolderItem, ghidra.framework.store.FileSystem)
-
openAssociatedUserFile
protected final DBHandle openAssociatedUserFile(java.lang.String associatedFileID, java.lang.String associatedContentType, FileSystem userfs, TaskMonitor monitor) throws java.io.IOException, CancelledException
Open user data file associatedDbh- Parameters:
associatedFileID
-associatedContentType
-userfs
-monitor
-- Returns:
- user data file database handle
- Throws:
java.io.IOException
CancelledException
-
-