Package ghidra.framework.store.local
Class LocalTextDataItem
java.lang.Object
ghidra.framework.store.local.LocalFolderItem
ghidra.framework.store.local.LocalTextDataItem
- All Implemented Interfaces:
FolderItem,TextDataItem
LocalTextDataItem provides a LocalFolderItem implementation
which stores text data within the associated propertyFile and without any other data storage.-
Field Summary
Fields inherited from interface ghidra.framework.store.FolderItem
DATABASE_FILE_TYPE, DATAFILE_FILE_TYPE, DEFAULT_CHECKOUT_ID, LATEST_VERSION, LINK_FILE_TYPE, UNKNOWN_FILE_TYPE -
Constructor Summary
ConstructorsConstructorDescriptionLocalTextDataItem(LocalFileSystem fileSystem, ItemPropertyFile propertyFile) Constructor for an existing local link file item which corresponds to the specified property file.LocalTextDataItem(LocalFileSystem fileSystem, ItemPropertyFile propertyFile, String fileID, String contentType, String textData) Create a new local text data file item. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns true if unsaved file changes can be recovered.intReturn the latest/current version.Get the text data that was stored with this itemVersion[]Returns list of all available versions or null if item is not versioned.longlength()Returns the length of this domain file.voidoutput(File outputFile, int version, TaskMonitor monitor) Serialize (i.e., pack) this item into the specified outputFile.voidsetVersionInfo(Version version) Set the version info associated with this versioned file.voidupdateCheckout(FolderItem versionedFolderItem, boolean updateItem, TaskMonitor monitor) Update this non-versioned item with the latest version of the specified versioned item.voidupdateCheckout(FolderItem item, int checkoutVersion) Update this non-versioned item with the contents of the specified item which must be within the same non-versioned fileSystem.Methods inherited from class ghidra.framework.store.local.LocalFolderItem
checkout, clearCheckout, delete, equals, getCheckout, getCheckoutId, getCheckouts, getCheckoutVersion, getContentType, getContentTypeVersion, getFileID, getLocalCheckoutVersion, getName, getParentPath, getPathName, hasCheckouts, hashCode, isCheckedOut, isCheckedOutExclusive, isCheckinActive, isReadOnly, isVersioned, lastModified, refresh, resetFileID, setCheckout, setContentTypeVersion, setReadOnly, terminateCheckout, updateCheckoutVersionMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ghidra.framework.store.FolderItem
checkout, clearCheckout, delete, getCheckout, getCheckoutId, getCheckouts, getCheckoutVersion, getContentType, getContentTypeVersion, getFileID, getLocalCheckoutVersion, getName, getParentPath, getPathName, hasCheckouts, isCheckedOut, isCheckedOutExclusive, isCheckinActive, isReadOnly, isVersioned, lastModified, refresh, resetFileID, setCheckout, setContentTypeVersion, setReadOnly, terminateCheckout, updateCheckoutVersion
-
Constructor Details
-
LocalTextDataItem
public LocalTextDataItem(LocalFileSystem fileSystem, ItemPropertyFile propertyFile) throws IOException Constructor for an existing local link file item which corresponds to the specified property file.- Parameters:
fileSystem- file systempropertyFile- database property file- Throws:
IOException- if an IO Error occurs
-
LocalTextDataItem
public LocalTextDataItem(LocalFileSystem fileSystem, ItemPropertyFile propertyFile, String fileID, String contentType, String textData) throws IOException Create a new local text data file item.- Parameters:
fileSystem- file systempropertyFile- serialized data property filefileID- file ID to be associated with new file or nullcontentType- user content typetextData- text to be stored within associated property file- Throws:
IOException- if an IO Error occurs
-
-
Method Details
-
getTextData
Get the text data that was stored with this item- Specified by:
getTextDatain interfaceTextDataItem- Returns:
- text data
-
length
Description copied from interface:FolderItemReturns the length of this domain file. This size is the minimum disk space used for storing this file, but does not account for additional storage space used to tracks changes, etc.- Specified by:
lengthin interfaceFolderItem- Returns:
- file length
- Throws:
IOException- thrown if IO or access error occurs
-
updateCheckout
public void updateCheckout(FolderItem versionedFolderItem, boolean updateItem, TaskMonitor monitor) throws IOException Description copied from class:LocalFolderItemUpdate this non-versioned item with the latest version of the specified versioned item.- Specified by:
updateCheckoutin classLocalFolderItem- Parameters:
versionedFolderItem- versioned item which corresponds to this non-versioned item.updateItem- if true this items content is updated using the versionedFolderItemmonitor- progress monitor for update- Throws:
IOException- if this file is not a checked-out non-versioned file or an IO error occurs.
-
updateCheckout
Description copied from class:LocalFolderItemUpdate this non-versioned item with the contents of the specified item which must be within the same non-versioned fileSystem. If successful, the specified item will be removed after its content has been moved into this item.- Specified by:
updateCheckoutin classLocalFolderItem- Parameters:
item-checkoutVersion-- Throws:
IOException- if this file is not a checked-out non-versioned file or an IO error occurs.
-
output
Description copied from interface:FolderItemSerialize (i.e., pack) this item into the specified outputFile.- Specified by:
outputin interfaceFolderItem- Parameters:
outputFile- packed output file to be createdversion- if this item is versioned, specifies the version to be output, otherwise -1 should be specified.monitor- progress monitor- Throws:
IOException
-
getCurrentVersion
public int getCurrentVersion()Description copied from interface:FolderItemReturn the latest/current version.- Specified by:
getCurrentVersionin interfaceFolderItem
-
canRecover
public boolean canRecover()Description copied from interface:FolderItemReturns true if unsaved file changes can be recovered.- Specified by:
canRecoverin interfaceFolderItem
-
setVersionInfo
Set the version info associated with this versioned file. Only a single version is supported.- Parameters:
version- version information (only user, create time and comment is retained)- Throws:
IOException- if an IO error occurs
-
getVersions
Description copied from interface:FolderItemReturns list of all available versions or null if item is not versioned.- Specified by:
getVersionsin interfaceFolderItem- Overrides:
getVersionsin classLocalFolderItem- Throws:
IOException- thrown if an IO error occurs.- See Also:
-