Package ghidra.framework.data

# Class DomainFileProxy

java.lang.Object
ghidra.framework.data.DomainFileProxy

All Implemented Interfaces:
  `DomainFile`, `Comparable<DomainFile>`

public class DomainFileProxy extends Object implements DomainFile
Implements the DomainFile interface for DomainObjects that are not currently associated with any real DomainFile. This class enforces the sharing of objects between tools. After the first tool gets the implementation, all other gets() just get the same instance. This class also keeps track of which tools are using a its domain object.

- ## Field Summary

  ### Fields inherited from interface ghidra.framework.model.DomainFile

  `DEFAULT_VERSION, READ_ONLY_PROPERTY, UNSUPPORTED_FILE_ICON`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `DomainFileProxy(String name, DomainObjectAdapter doa)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addToVersionControl(String comment, boolean keepCheckedOut, TaskMonitor monitor)`
  Adds this private file to version control.
  `boolean`
  `canAddToRepository()`
  Returns true if this private file may be added to the associated repository.
  `boolean`
  `canCheckin()`
  Returns true if this file may be checked-in to the associated repository.
  `boolean`
  `canCheckout()`
  Returns true if this file may be checked-out from the associated repository.
  `boolean`
  `canMerge()`
  Returns true if this file can be merged with the current versioned file.
  `boolean`
  `canRecover()`
  Prior to invoking getDomainObject, this method can be used to determine if unsaved changes can be recovered on the next open.
  `boolean`
  `canSave()`
  Return whether this domain object can be saved (i.e., updated/overwritten).
  `void`
  `checkin(CheckinHandler checkinHandler, boolean okToUpgrade, TaskMonitor monitor)`
  Performs check in to associated repository.
  `boolean`
  `checkout(boolean exclusive, TaskMonitor monitor)`
  Checkout this file for update.
  `int`
  `compareTo(DomainFile df)`
  `DomainFile`
  `copyTo(DomainFolder newParent, TaskMonitor monitor)`
  Copy this file into the newParent folder as a private file.
  `DomainFile`
  `copyToAsLink(DomainFolder newParent)`
  Copy this file into the newParent folder as a link file.
  `DomainFile`
  `copyVersionTo(int ver, DomainFolder destFolder, TaskMonitor monitor)`
  Copy a specific version of this file to the specified destFolder.
  `void`
  `delete()`
  Delete the entire database for this file, including any version files.
  `void`
  `delete(int fileVersion)`
  Deletes a specific version of a file from the versioned filesystem.
  `boolean`
  `equals(Object obj)`
  `boolean`
  `exists()`
  Check for existence of domain file.
  `DomainFolder`
  `followLink()`
  If this is a folder-link file get the corresponding linked folder.
  `ChangeSet`
  `getChangesByOthersSinceCheckout()`
  Returns changes made to versioned file by others since checkout was performed.
  `ItemCheckoutStatus[]`
  `getCheckouts()`
  Get a list of checkouts by all users for the associated versioned file.
  `ItemCheckoutStatus`
  `getCheckoutStatus()`
  Get checkout status associated with a versioned file.
  `ArrayList<?>`
  `getConsumers()`
  Get the list of consumers (Objects) for this domain file.
  `String`
  `getContentType()`
  Returns content-type string for this file
  `DomainObject`
  `getDomainObject(Object consumer, boolean okToUpgrade, boolean okToRecover, TaskMonitor monitor)`
  Opens and returns the current domain object.
  `Class<? extends DomainObject>`
  `getDomainObjectClass()`
  Returns the underlying Class for the domain object in this domain file.
  `String`
  `getFileID()`
  Returns a unique file-ID
  `Icon`
  `getIcon(boolean disabled)`
  Get the state based Icon image for the domain file based upon its content class.
  `DomainObject`
  `getImmutableDomainObject(Object consumer, int fileVersion, TaskMonitor monitor)`
  Returns a new DomainObject that cannot be changed or saved to its original file.
  `long`
  `getLastModifiedTime()`
  Get a long value representing the time when the data was last modified.
  `int`
  `getLatestVersion()`
  Return the latest version
  `URL`
  `getLocalProjectURL(String ref)`
  Get a local Ghidra URL for this domain file if available within the associated non-transient local project.
  `Map<String,String>`
  `getMetadata()`
  Returns an ordered map containing the metadata that has been associated with the corresponding domain object.
  `String`
  `getName()`
  Get the name of this project file
  `DomainObject`
  `getOpenedDomainObject(Object consumer)`
  Returns the domainObject for this DomainFile only if it is already open.
  `DomainFolder`
  `getParent()`
  Get the parent domain folder for this domain file.
  `String`
  `getPathname()`
  Returns the full path name to this file
  `ProjectLocator`
  `getProjectLocator()`
  Returns the local storage location for the project that this DomainFile belongs to.
  `DomainObject`
  `getReadOnlyDomainObject(Object consumer, int fileVersion, TaskMonitor monitor)`
  Returns a "read-only" version of the domain object.
  `URL`
  `getSharedProjectURL(String ref)`
  Get a remote Ghidra URL for this domain file if available within an associated shared project repository.
  `int`
  `getVersion()`
  Return either the latest version if the file is not checked-out or the version that was checked-out or a specific version that was requested.
  `Version[]`
  `getVersionHistory()`
  Returns list of all available versions.
  `int`
  `hashCode()`
  `boolean`
  `isBusy()`
  Returns true if the domain object in this domain file exists and has an open transaction.
  `boolean`
  `isChanged()`
  Return whether the domain object in this domain file has changed.
  `boolean`
  `isCheckedOut()`
  Returns true if this is a checked-out file.
  `boolean`
  `isCheckedOutExclusive()`
  Returns true if this a checked-out file with exclusive access.
  `boolean`
  `isHijacked()`
  Returns true if the file is versioned but a private copy also exists.
  `boolean`
  `isInUse()`
  `boolean`
  `isInWritableProject()`
  Returns true if this file is in a writable project.
  `boolean`
  `isLatestVersion()`
  Returns true if this file represents the latest version of the associated domain object.
  `boolean`
  `isLinkFile()`
  Determine if this file is a link file which corresponds to either a file or folder link.
  `boolean`
  `isLinkingSupported()`
  Determine if this file's content type supports linking.
  `boolean`
  `isOpen()`
  Returns true if there is an open domainObject for this file.
  `boolean`
  `isReadOnly()`
  Returns whether the object is read-only.
  `boolean`
  `isUsedBy(Object consumer)`
  `boolean`
  `isVersioned()`
  Return true if this is a versioned database, else false
  `long`
  `length()`
  Returns the length of this domain file.
  `void`
  `merge(boolean okToUpgrade, TaskMonitor monitor)`
  Performs merge from current version of versioned file into local checked-out file.
  `boolean`
  `modifiedSinceCheckout()`
  Returns true if this is a checked-out file which has been modified since it was checked-out.
  `DomainFile`
  `moveTo(DomainFolder newParent)`
  Move this file into the newParent folder.
  `void`
  `packFile(File file, TaskMonitor monitor)`
  Pack domain file into specified file.
  `void`
  `save(TaskMonitor monitor)`
  Save the `DomainObject` associated with this file.
  `DomainFile`
  `setName(String newName)`
  Set the name on this domain file.
  `void`
  `setReadOnly(boolean state)`
  Sets the object to read-only.
  `boolean`
  `takeRecoverySnapshot()`
  If the file has an updatable domain object with unsaved changes, generate a recovery snapshot.
  `void`
  `terminateCheckout(long checkoutId)`
  Forcefully terminate a checkout for the associated versioned file.
  `String`
  `toString()`
  `void`
  `undoCheckout(boolean keep)`
  Undo "checked-out" file.
  `void`
  `undoCheckout(boolean keep, boolean force)`
  Undo "checked-out" file.

  ### Methods inherited from class java.lang.Object

  `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### DomainFileProxy

    public DomainFileProxy(String name, DomainObjectAdapter doa)

- ## Method Details

  - ### exists

    public boolean exists()
    Description copied from interface: `DomainFile`
    Check for existence of domain file.
    Specified by:
      `exists` in interface `DomainFile`
    Returns:
      true if file exists. A proxy domain file will always return false.

  - ### setName

    public DomainFile setName(String newName)
    Description copied from interface: `DomainFile`
    Set the name on this domain file.
    Specified by:
      `setName` in interface `DomainFile`
    Parameters:
      `newName` - domain file name
    Returns:
      renamed domain file (the original DomainFile object becomes invalid since it is immutable)

  - ### getProjectLocator

    public ProjectLocator getProjectLocator()
    Description copied from interface: `DomainFile`
    Returns the local storage location for the project that this DomainFile belongs to.
    Specified by:
      `getProjectLocator` in interface `DomainFile`
    Returns:
      the location

  - ### length

    public long length() throws IOException
    Description copied from interface: `DomainFile`
    Returns 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 track changes, etc.
    Specified by:
      `length` in interface `DomainFile`
    Returns:
      file length
    Throws:
      `IOException` - if IO or access error occurs

  - ### isReadOnly

    public boolean isReadOnly()
    Description copied from interface: `DomainFile`
    Returns whether the object is read-only. From a framework point of view a read-only object can never be changed.
    Specified by:
      `isReadOnly` in interface `DomainFile`
    Returns:
      true if read-only

  - ### setReadOnly

    public void setReadOnly(boolean state)
    Description copied from interface: `DomainFile`
    Sets the object to read-only. This method may only be invoked for private files (i.e., not versioned).
    Specified by:
      `setReadOnly` in interface `DomainFile`
    Parameters:
      `state` - if true file will be read-only and may not be updated, if false the file may be updated.

  - ### isInWritableProject

    public boolean isInWritableProject()
    Description copied from interface: `DomainFile`
    Returns true if this file is in a writable project.
    Specified by:
      `isInWritableProject` in interface `DomainFile`
    Returns:
      true if writable

  - ### getPathname

    public String getPathname()
    Description copied from interface: `DomainFile`
    Returns the full path name to this file
    Specified by:
      `getPathname` in interface `DomainFile`
    Returns:
      the path name

  - ### getSharedProjectURL

    public URL getSharedProjectURL(String ref)
    Description copied from interface: `DomainFile`
    Get a remote Ghidra URL for this domain file if available within an associated shared project repository. A null value will be returned if shared file does not exist and may also be returned if shared repository is not connected or a connection error occurs.
    Specified by:
      `getSharedProjectURL` in interface `DomainFile`
    Parameters:
      `ref` - reference within a file, may be null. NOTE: such reference interpretation is specific to a domain object and tooling with limited support.
    Returns:
      remote Ghidra URL for this file or null

  - ### getLocalProjectURL

    public URL getLocalProjectURL(String ref)
    Description copied from interface: `DomainFile`
    Get a local Ghidra URL for this domain file if available within the associated non-transient local project. A null value will be returned if project is transient.
    Specified by:
      `getLocalProjectURL` in interface `DomainFile`
    Parameters:
      `ref` - reference within a file, may be null. NOTE: such reference interpretation is specific to a domain object and tooling with limited support.
    Returns:
      local Ghidra URL for this file or null if transient or not applicable

  - ### compareTo

    public int compareTo(DomainFile df)
    Specified by:
      `compareTo` in interface `Comparable<DomainFile>`

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`

  - ### getName

    public String getName()
    Description copied from interface: `DomainFile`
    Get the name of this project file
    Specified by:
      `getName` in interface `DomainFile`
    Returns:
      the name

  - ### getFileID

    public String getFileID()
    Description copied from interface: `DomainFile`
    Returns a unique file-ID
    Specified by:
      `getFileID` in interface `DomainFile`
    Returns:
      the ID

  - ### getContentType

    public String getContentType()
    Description copied from interface: `DomainFile`
    Returns content-type string for this file
    Specified by:
      `getContentType` in interface `DomainFile`
    Returns:
      the file content type or a reserved content type `ContentHandler.MISSING_CONTENT` or `ContentHandler.UNKNOWN_CONTENT`.

  - ### isLinkFile

    public boolean isLinkFile()
    Description copied from interface: `DomainFile`
    Determine if this file is a link file which corresponds to either a file or folder link. The `DomainObject` referenced by a link-file may be opened using `DomainFile.getReadOnlyDomainObject(Object, int, TaskMonitor)`. The `DomainFile.getDomainObject(Object, boolean, boolean, TaskMonitor)` method may also be used to obtain a read-only instance. `DomainFile.getImmutableDomainObject(Object, int, TaskMonitor)` use is not supported. If the link-file content type equals "FolderLink" the method `DomainFile.followLink()` can be used to get the linked domain folder. The associated link URL may be obtained with `LinkHandler.getURL(DomainFile)`. The content type (see `DomainFile.getContentType()` of a link file will differ from that of the linked object (e.g., "LinkedProgram" vs "Program").
    Specified by:
      `isLinkFile` in interface `DomainFile`
    Returns:
      true if link file else false for a normal domain file

  - ### followLink

    public DomainFolder followLink()
    Description copied from interface: `DomainFile`
    If this is a folder-link file get the corresponding linked folder.
    Specified by:
      `followLink` in interface `DomainFile`
    Returns:
      a linked domain folder or null if not a folder-link.

  - ### getDomainObjectClass

    public Class<? extends DomainObject> getDomainObjectClass()
    Description copied from interface: `DomainFile`
    Returns the underlying Class for the domain object in this domain file.
    Specified by:
      `getDomainObjectClass` in interface `DomainFile`
    Returns:
      the class or null if does not correspond to a domain object.

  - ### getParent

    public DomainFolder getParent()
    Description copied from interface: `DomainFile`
    Get the parent domain folder for this domain file.
    Specified by:
      `getParent` in interface `DomainFile`
    Returns:
      the parent

  - ### getLastModifiedTime

    public long getLastModifiedTime()
    Description copied from interface: `DomainFile`
    Get a long value representing the time when the data was last modified.
    Specified by:
      `getLastModifiedTime` in interface `DomainFile`
    Returns:
      the time

  - ### save

    public void save(TaskMonitor monitor) throws IOException
    Description copied from interface: `DomainFile`
    Save the `DomainObject` associated with this file.
    Specified by:
      `save` in interface `DomainFile`
    Parameters:
      `monitor` - monitor for the task that is doing the save on the file
    Throws:
      `FileInUseException` - if the file is open for update by someone else, or a transient-read is in progress.
      `IOException` - if an IO error occurs.

  - ### canSave

    public boolean canSave()
    Description copied from interface: `DomainFile`
    Return whether this domain object can be saved (i.e., updated/overwritten).
    Specified by:
      `canSave` in interface `DomainFile`
    Returns:
      true if the user is the owner AND the file is in the active project AND the file is not read-only.

  - ### canRecover

    public boolean canRecover()
    Description copied from interface: `DomainFile`
    Prior to invoking getDomainObject, this method can be used to determine if unsaved changes can be recovered on the next open.
    Specified by:
      `canRecover` in interface `DomainFile`
    Returns:
      true if recovery data exists.

  - ### takeRecoverySnapshot

    public boolean takeRecoverySnapshot()
    Description copied from interface: `DomainFile`
    If the file has an updatable domain object with unsaved changes, generate a recovery snapshot.
    Specified by:
      `takeRecoverySnapshot` in interface `DomainFile`
    Returns:
      true if snapshot successful or not needed, false if file is busy which prevents snapshot, or snapshot was cancelled.

  - ### isInUse

    public boolean isInUse()

  - ### getConsumers

    public ArrayList<?> getConsumers()
    Description copied from interface: `DomainFile`
    Get the list of consumers (Objects) for this domain file.
    Specified by:
      `getConsumers` in interface `DomainFile`
    Returns:
      true if linking is supported allowing a link-file to be created which references this file, else false.

  - ### hashCode

    public int hashCode()
    Overrides:
      `hashCode` in class `Object`

  - ### equals

    public boolean equals(Object obj)
    Overrides:
      `equals` in class `Object`

  - ### isUsedBy

    public boolean isUsedBy(Object consumer)

  - ### addToVersionControl

    public void addToVersionControl(String comment, boolean keepCheckedOut, TaskMonitor monitor) throws IOException, CancelledException
    Description copied from interface: `DomainFile`
    Adds this private file to version control.
    Specified by:
      `addToVersionControl` in interface `DomainFile`
    Parameters:
      `comment` - new version comment
      `keepCheckedOut` - if true, the file will be initially checked-out
      `monitor` - progress monitor
    Throws:
      `FileInUseException` - if this file is in-use.
      `IOException` - if an IO or access error occurs. Also if file is not private.
      `CancelledException` - if the monitor cancelled the operation

  - ### canAddToRepository

    public boolean canAddToRepository()
    Description copied from interface: `DomainFile`
    Returns true if this private file may be added to the associated repository.
    Specified by:
      `canAddToRepository` in interface `DomainFile`
    Returns:
      true if can add to the repository

  - ### isBusy

    public boolean isBusy()
    Description copied from interface: `DomainFile`
    Returns true if the domain object in this domain file exists and has an open transaction.
    Specified by:
      `isBusy` in interface `DomainFile`
    Returns:
      true if busy

  - ### canCheckout

    public boolean canCheckout()
    Description copied from interface: `DomainFile`
    Returns true if this file may be checked-out from the associated repository. User's with read-only repository access will not have checkout ability.
    Specified by:
      `canCheckout` in interface `DomainFile`
    Returns:
      true if can checkout

  - ### canCheckin

    public boolean canCheckin()
    Description copied from interface: `DomainFile`
    Returns true if this file may be checked-in to the associated repository.
    Specified by:
      `canCheckin` in interface `DomainFile`
    Returns:
      true if can check-in

  - ### canMerge

    public boolean canMerge()
    Description copied from interface: `DomainFile`
    Returns true if this file can be merged with the current versioned file.
    Specified by:
      `canMerge` in interface `DomainFile`
    Returns:
      true if can merge

  - ### checkout

    public boolean checkout(boolean exclusive, TaskMonitor monitor)
    Description copied from interface: `DomainFile`
    Checkout this file for update. If this file is already private, this method does nothing.
    Specified by:
      `checkout` in interface `DomainFile`
    Parameters:
      `exclusive` - if true an exclusive checkout will be requested
      `monitor` - progress monitor
    Returns:
      true if checkout successful, false if an exclusive checkout was not possible due to other users having checkouts of this file. A request for a non-exclusive checkout will never return false.

  - ### checkin

    public void checkin(CheckinHandler checkinHandler, boolean okToUpgrade, TaskMonitor monitor) throws IOException, VersionException, CancelledException
    Description copied from interface: `DomainFile`
    Performs check in to associated repository. File must be checked-out and modified since checkout.
    Specified by:
      `checkin` in interface `DomainFile`
    Parameters:
      `checkinHandler` - provides user input data to complete checkin process.
      `okToUpgrade` - if true an upgrade will be performed if needed
      `monitor` - the TaskMonitor.
    Throws:
      `IOException` - if an IO or access error occurs
      `VersionException` - if unable to handle domain object version in versioned filesystem. If okToUpgrade was false, check exception to see if it can be upgraded sometime after doing a checkout.
      `CancelledException` - if task monitor cancelled operation

  - ### merge

    public void merge(boolean okToUpgrade, TaskMonitor monitor)
    Description copied from interface: `DomainFile`
    Performs merge from current version of versioned file into local checked-out file.
    Specified by:
      `merge` in interface `DomainFile`
    Parameters:
      `okToUpgrade` - if true an upgrade will be performed if needed
      `monitor` - task monitor

  - ### isLinkingSupported

    public boolean isLinkingSupported()
    Description copied from interface: `DomainFile`
    Determine if this file's content type supports linking.
    Specified by:
      `isLinkingSupported` in interface `DomainFile`
    Returns:
      true if linking is supported, else false.

  - ### copyToAsLink

    public DomainFile copyToAsLink(DomainFolder newParent) throws IOException
    Description copied from interface: `DomainFile`
    Copy this file into the newParent folder as a link file. Restrictions:
    - Specified newParent must reside within a different project since internal linking is not currently supported.
    - Content type must support linking (see `DomainFile.isLinkingSupported()`).
    If this file is associated with a temporary transient project (i.e., not a locally managed project) the generated link will refer to the remote file with a remote Ghidra URL, otherwise a local project storage path will be used.
    Specified by:
      `copyToAsLink` in interface `DomainFile`
    Parameters:
      `newParent` - new parent folder
    Returns:
      newly created domain file or null if content type does not support link use.
    Throws:
      `IOException` - if an IO or access error occurs.

  - ### copyTo

    public DomainFile copyTo(DomainFolder newParent, TaskMonitor monitor) throws IOException, CancelledException
    Description copied from interface: `DomainFile`
    Copy this file into the newParent folder as a private file.
    Specified by:
      `copyTo` in interface `DomainFile`
    Parameters:
      `newParent` - new parent folder
      `monitor` - task monitor
    Returns:
      newly created domain file
    Throws:
      `FileInUseException` - if this file is in-use / checked-out.
      `IOException` - if an IO or access error occurs.
      `CancelledException` - if task monitor cancelled operation.

  - ### copyVersionTo

    public DomainFile copyVersionTo(int ver, DomainFolder destFolder, TaskMonitor monitor) throws IOException, CancelledException
    Description copied from interface: `DomainFile`
    Copy a specific version of this file to the specified destFolder.
    Specified by:
      `copyVersionTo` in interface `DomainFile`
    Parameters:
      `ver` - version to copy
      `destFolder` - destination parent folder
      `monitor` - task monitor
    Returns:
      the copied file
    Throws:
      `IOException` - if an IO or access error occurs.
      `CancelledException` - if task monitor cancelled operation.

  - ### delete

    public void delete() throws IOException
    Description copied from interface: `DomainFile`
    Delete the entire database for this file, including any version files.
    Specified by:
      `delete` in interface `DomainFile`
    Throws:
      `FileInUseException` - if this file is in-use / checked-out.
      `UserAccessException` - if the user does not have permission to delete the file.
      `IOException` - if an IO or access error occurs.

  - ### delete

    public void delete(int fileVersion) throws IOException
    Description copied from interface: `DomainFile`
    Deletes a specific version of a file from the versioned filesystem.
    Specified by:
      `delete` in interface `DomainFile`
    Parameters:
      `fileVersion` - specific version to be deleted. The version must either be the oldest or latest, or -1 which will attempt to remove all versions. When deleting the latest version, this method could take a long time to return since the previous version must be reconstructed within the versioned filesystem.
    Throws:
      `IOException` - if an IO error occurs, including the inability to delete a version because this item is checked-out, the user does not have permission, or the specified version is not the oldest or latest.

  - ### getLatestVersion

    public int getLatestVersion()
    Description copied from interface: `DomainFile`
    Return the latest version
    Specified by:
      `getLatestVersion` in interface `DomainFile`
    Returns:
      the version

  - ### isLatestVersion

    public boolean isLatestVersion()
    Description copied from interface: `DomainFile`
    Returns true if this file represents the latest version of the associated domain object.
    Specified by:
      `isLatestVersion` in interface `DomainFile`
    Returns:
      true if the latest version

  - ### getVersion

    public int getVersion()
    Description copied from interface: `DomainFile`
    Return either the latest version if the file is not checked-out or the version that was checked-out or a specific version that was requested.
    Specified by:
      `getVersion` in interface `DomainFile`
    Returns:
      the version

  - ### getVersionHistory

    public Version[] getVersionHistory() throws IOException
    Description copied from interface: `DomainFile`
    Returns list of all available versions.
    Specified by:
      `getVersionHistory` in interface `DomainFile`
    Returns:
      the versions
    Throws:
      `IOException` - if there is an exception getting the history

  - ### isCheckedOut

    public boolean isCheckedOut()
    Description copied from interface: `DomainFile`
    Returns true if this is a checked-out file.
    Specified by:
      `isCheckedOut` in interface `DomainFile`
    Returns:
      true if checked-out

  - ### isCheckedOutExclusive

    public boolean isCheckedOutExclusive()
    Description copied from interface: `DomainFile`
    Returns true if this a checked-out file with exclusive access.
    Specified by:
      `isCheckedOutExclusive` in interface `DomainFile`
    Returns:
      true if checked-out exclusively

  - ### moveTo

    public DomainFile moveTo(DomainFolder newParent) throws IOException
    Description copied from interface: `DomainFile`
    Move this file into the newParent folder.
    Specified by:
      `moveTo` in interface `DomainFile`
    Parameters:
      `newParent` - new parent folder within the same project
    Returns:
      the newly relocated domain file (the original DomainFile object becomes invalid since it is immutable)
    Throws:
      `DuplicateFileException` - if a file with the same name already exists in newParent folder.
      `FileInUseException` - if this file is in-use / checked-out.
      `IOException` - if an IO or access error occurs.

  - ### undoCheckout

    public void undoCheckout(boolean keep) throws IOException
    Description copied from interface: `DomainFile`
    Undo "checked-out" file. The original repository file is restored.
    Specified by:
      `undoCheckout` in interface `DomainFile`
    Parameters:
      `keep` - if true, the private database will be renamed with a .keep extension.
    Throws:
      `NotConnectedException` - if shared project and not connected to repository
      `FileInUseException` - if this file is in-use.
      `IOException` - if file is not checked-out or an IO / access error occurs.

  - ### undoCheckout

    public void undoCheckout(boolean keep, boolean force) throws IOException
    Description copied from interface: `DomainFile`
    Undo "checked-out" file. The original repository file is restored.
    Specified by:
      `undoCheckout` in interface `DomainFile`
    Parameters:
      `keep` - if true, the private database will be renamed with a .keep extension.
      `force` - if not connected to the repository the local checkout file will be removed. Warning: forcing undo checkout will leave a stale checkout in place for the associated repository if not connected.
    Throws:
      `NotConnectedException` - if shared project and not connected to repository and force is false
      `FileInUseException` - if this file is in-use / checked-out.
      `IOException` - thrown if file is not checked-out or an IO / access error occurs.

  - ### getChangesByOthersSinceCheckout

    public ChangeSet getChangesByOthersSinceCheckout() throws IOException
    Description copied from interface: `DomainFile`
    Returns changes made to versioned file by others since checkout was performed. NOTE: This method is unable to cope with version issues which may require an upgrade.
    Specified by:
      `getChangesByOthersSinceCheckout` in interface `DomainFile`
    Returns:
      change set or null
    Throws:
      `IOException` - if a folder item access error occurs or change set was produced by newer version of software and can not be read

  - ### getDomainObject

    public DomainObject getDomainObject(Object consumer, boolean okToUpgrade, boolean okToRecover, TaskMonitor monitor) throws VersionException, IOException
    Description copied from interface: `DomainFile`
    Opens and returns the current domain object. If the domain object is already opened, then the existing open domain object is returned.
    Specified by:
      `getDomainObject` in interface `DomainFile`
    Parameters:
      `consumer` - consumer of the domain object which is responsible for releasing it after use. When all the consumers using the domain object release it, then the object is closed and its resources released.
      `okToUpgrade` - if true, allows the system to upgrade out of data domain objects to be in compliance with the current version of Ghidra. A Version exception will be thrown if the domain object cannot be upgraded OR okToUpgrade is false and the domain object is out of date.
      `okToRecover` - if true, allows the system to recover unsaved file changes which resulted from a crash. If false, any existing recovery data will be deleted. This flag is only relevant if project is open for update (isInProject) and the file can be opened for update.
      `monitor` - permits monitoring of open progress.
    Returns:
      an open domain object can be modified and saved. (Not read-only)
    Throws:
      `VersionException` - if the domain object could not be read due to a version format change. If okToUpgrade is true, then a VersionException indicates that the domain object cannot be upgraded to the current format. If okToUpgrade is false, then the VersionException only means the object is not in the current format - it may or may not be possible to upgrade.
      `IOException` - if an IO or access error occurs.

  - ### getOpenedDomainObject

    public DomainObject getOpenedDomainObject(Object consumer)
    Description copied from interface: `DomainFile`
    Returns the domainObject for this DomainFile only if it is already open.
    Specified by:
      `getOpenedDomainObject` in interface `DomainFile`
    Parameters:
      `consumer` - the consumer that will use the object.
    Returns:
      the already opened domainObject or null if it is not currently open.

  - ### isVersioned

    public boolean isVersioned()
    Description copied from interface: `DomainFile`
    Return true if this is a versioned database, else false
    Specified by:
      `isVersioned` in interface `DomainFile`
    Returns:
      true if versioned

  - ### packFile

    public void packFile(File file, TaskMonitor monitor) throws IOException, CancelledException
    Description copied from interface: `DomainFile`
    Pack domain file into specified file. Specified file will be overwritten if it already exists.
    Specified by:
      `packFile` in interface `DomainFile`
    Parameters:
      `file` - destination file
      `monitor` - the task monitor
    Throws:
      `IOException` - if there is an exception packing the file
      `CancelledException` - if monitor cancels operation

  - ### getIcon

    public Icon getIcon(boolean disabled)
    Description copied from interface: `DomainFile`
    Get the state based Icon image for the domain file based upon its content class.
    Specified by:
      `getIcon` in interface `DomainFile`
    Parameters:
      `disabled` - true if the icon return should be rendered as not enabled
    Returns:
      image icon

  - ### getImmutableDomainObject

    public DomainObject getImmutableDomainObject(Object consumer, int fileVersion, TaskMonitor monitor) throws VersionException, IOException, CancelledException
    Description copied from interface: `DomainFile`
    Returns a new DomainObject that cannot be changed or saved to its original file. NOTE: The use of this method should generally be avoided since it can't handle version changes that may have occured and require a data upgrade (e.g., DB schema change).
    Specified by:
      `getImmutableDomainObject` in interface `DomainFile`
    Parameters:
      `consumer` - consumer of the domain object which is responsible for releasing it after use.
      `fileVersion` - the domain object version requested. DEFAULT_VERSION should be specified to open the current version.
      `monitor` - permits monitoring of open progress.
    Returns:
      a new domain object that is disassociated from its original domain file and cannot be modified
    Throws:
      `VersionException` - if the domain object could not be read due to a version format change.
      `FileNotFoundException` - if the stored file/version was not found.
      `IOException` - if an IO or access error occurs.
      `CancelledException` - if monitor cancelled operation

  - ### getReadOnlyDomainObject

    public DomainObject getReadOnlyDomainObject(Object consumer, int fileVersion, TaskMonitor monitor) throws VersionException, IOException, CancelledException
    Description copied from interface: `DomainFile`
    Returns a "read-only" version of the domain object. "Read-only" means that the domain object cannot be saved back into its original domain object. It can still be modified and saved to a new domain file. The domain object will be assigned a temporary domain file that will not allow a "save" operation. The user must do a "save as" to a new filename.
    Specified by:
      `getReadOnlyDomainObject` in interface `DomainFile`
    Parameters:
      `consumer` - consumer of the domain object which is responsible for releasing it after use.
      `fileVersion` - the domain object version requested. DEFAULT_VERSION should be specified to open the current version.
      `monitor` - permits monitoring of open progress.
    Returns:
      a new domain object that is disassociated from its original domain file.
    Throws:
      `VersionException` - if the domain object could not be read due to a version format change.
      `FileNotFoundException` - if the stored file/version was not found.
      `IOException` - if an IO or access error occurs.
      `CancelledException` - if monitor cancelled operation

  - ### isHijacked

    public boolean isHijacked()
    Description copied from interface: `DomainFile`
    Returns true if the file is versioned but a private copy also exists.
    Specified by:
      `isHijacked` in interface `DomainFile`
    Returns:
      true if hijacked

  - ### modifiedSinceCheckout

    public boolean modifiedSinceCheckout()
    Description copied from interface: `DomainFile`
    Returns true if this is a checked-out file which has been modified since it was checked-out.
    Specified by:
      `modifiedSinceCheckout` in interface `DomainFile`
    Returns:
      true if modified since check-out

  - ### isChanged

    public boolean isChanged()
    Description copied from interface: `DomainFile`
    Return whether the domain object in this domain file has changed.
    Specified by:
      `isChanged` in interface `DomainFile`
    Returns:
      true if changed

  - ### isOpen

    public boolean isOpen()
    Description copied from interface: `DomainFile`
    Returns true if there is an open domainObject for this file.
    Specified by:
      `isOpen` in interface `DomainFile`
    Returns:
      true if open

  - ### terminateCheckout

    public void terminateCheckout(long checkoutId) throws IOException
    Description copied from interface: `DomainFile`
    Forcefully terminate a checkout for the associated versioned file. The user must be the owner of the checkout or have administrator privilege on the versioned filesystem (i.e., repository).
    Specified by:
      `terminateCheckout` in interface `DomainFile`
    Parameters:
      `checkoutId` - checkout ID
    Throws:
      `IOException` - if an IO or access error occurs

  - ### getCheckouts

    public ItemCheckoutStatus[] getCheckouts() throws IOException
    Description copied from interface: `DomainFile`
    Get a list of checkouts by all users for the associated versioned file.
    Specified by:
      `getCheckouts` in interface `DomainFile`
    Returns:
      list of checkouts
    Throws:
      `IOException` - if an IO or access error occurs

  - ### getCheckoutStatus

    public ItemCheckoutStatus getCheckoutStatus() throws IOException
    Description copied from interface: `DomainFile`
    Get checkout status associated with a versioned file.
    Specified by:
      `getCheckoutStatus` in interface `DomainFile`
    Returns:
      checkout status or null if not checked-out to current associated project.
    Throws:
      `IOException` - if an IO or access error occurs

  - ### getMetadata

    public Map<String,String> getMetadata()
    Description copied from interface: `DomainFile`
    Returns an ordered map containing the metadata that has been associated with the corresponding domain object. The map contains key,value pairs and are ordered by their insertion order.
    Specified by:
      `getMetadata` in interface `DomainFile`
    Returns:
      a map containing the metadata that has been associated with the corresponding domain object.