Class ItemPropertyFile

java.lang.Object
ghidra.util.PropertyFile
ghidra.framework.store.local.ItemPropertyFile
Direct Known Subclasses:
IndexedPropertyFile, InvalidPropertyFile

public class ItemPropertyFile extends PropertyFile
ItemPropertyFile provides basic property storage which is primarily intended to store limited information related to a logical FolderItem. The file extension used is PropertyFile.PROPERTY_EXT.
  • Field Details

    • name

      protected String name
    • parentPath

      protected String parentPath
  • Constructor Details

    • ItemPropertyFile

      public ItemPropertyFile(File dir, String storageName, String parentPath, String name) throws IOException
      Construct a new or existing PropertyFile. This constructor ignores retained property values for NAME and PARENT path. This constructor will not throw an exception if the file does not exist.
      Parameters:
      dir - native directory where this file is stored
      storageName - stored property file name (without extension)
      parentPath - logical parent path for the associated item
      name - name of the associated item
      Throws:
      InvalidObjectException - if a file parse error occurs
      IOException - if an IO error occurs reading an existing file
  • Method Details

    • getName

      public String getName()
      Return the name of the item associated with this PropertyFile. A null value may be returned if this is an older property file and the name was not specified at time of construction.
      Returns:
      associated item name or null if unknown
    • getPath

      public String getPath()
      Return the logical path of the item associated with this PropertyFile. A null value may be returned if this is an older property file and the name and parentPath was not specified at time of construction.
      Returns:
      logical path of the associated item or null if unknown
    • getParentPath

      public String getParentPath()
      Return the logical parent path containing the item descibed by this PropertyFile.
      Returns:
      logical parent directory path
    • getFileID

      public String getFileID()
      Returns the FileID associated with this file.
      Returns:
      FileID associated with this file or null
    • setFileID

      public void setFileID(String fileId)
      Set the FileID associated with this file.
      Parameters:
      fileId - unique file ID
    • moveTo

      public void moveTo(File newStorageParent, String newStorageName, String newParentPath, String newName) throws DuplicateFileException, IOException
      Move this PropertyFile to the newParent file.
      Parameters:
      newStorageParent - new storage parent of the native file
      newStorageName - new storage name for this property file
      newParentPath - new logical parent path
      newName - new logical item name
      Throws:
      IOException - thrown if there was a problem accessing the
      DuplicateFileException - thrown if a file with the newName already exists
    • moveTo

      @Deprecated(forRemoval=false, since="11.4") public final void moveTo(File newStorageParent, String newStorageName) throws javax.help.UnsupportedOperationException
      Deprecated.
      method must not be used
      NOTE!! This method must not be used.

      Movement of an item is related to its logical pathname and must be accomplished with the moveTo(File, String, String, String) method. There is no supported direct use of this method.

      Overrides:
      moveTo in class PropertyFile
      Parameters:
      newStorageParent - new storage parent of the native file
      newStorageName - new storage name for this property file
      Throws:
      javax.help.UnsupportedOperationException - always thrown