Class MangledLocalFileSystem

java.lang.Object
ghidra.framework.store.local.LocalFileSystem
ghidra.framework.store.local.MangledLocalFileSystem
All Implemented Interfaces:
FileSystem

public class MangledLocalFileSystem extends LocalFileSystem
MangledLocalFileSystem implements the legacy project data storage scheme which utilizes a simplified name mangling which provides case-sensitive file-naming with support for spaces. Project folder hierarchy maps directly to the actual storage hierarchy.
  • Field Details

  • Method Details

    • getMaxNameLength

      public int getMaxNameLength()
      Specified by:
      getMaxNameLength in class LocalFileSystem
      Returns:
      the maximum name length permitted for folders or items.
    • findItemStorage

      protected LocalFileSystem.ItemStorage findItemStorage(String folderPath, String itemName) throws FileNotFoundException
      Find an existing storage location
      Specified by:
      findItemStorage in class LocalFileSystem
      Parameters:
      folderPath -
      itemName -
      Returns:
      storage location. A non-null value does not guarantee that the associated item actually exists.
      Throws:
      FileNotFoundException
    • allocateItemStorage

      protected LocalFileSystem.ItemStorage allocateItemStorage(String folderPath, String itemName) throws IOException, InvalidNameException
      Allocate a new storage location
      Specified by:
      allocateItemStorage in class LocalFileSystem
      Parameters:
      folderPath -
      itemName -
      Returns:
      storage location
      Throws:
      DuplicateFileException - if item path has previously been allocated
      IOException - if invalid path/item name specified
      InvalidNameException - if folderPath or itemName contains invalid characters
    • deallocateItemStorage

      protected void deallocateItemStorage(String folderPath, String itemName)
      Deallocate item storage
      Specified by:
      deallocateItemStorage in class LocalFileSystem
      Parameters:
      folderPath -
      itemName -
    • getItemCount

      public int getItemCount()
      Description copied from interface: FileSystem
      Returns the number of folder items contained within this file-system.
    • getItemNames

      public String[] getItemNames(String folderPath, boolean includeHiddenFiles) throws IOException
      Specified by:
      getItemNames in class LocalFileSystem
      Throws:
      IOException
    • getFolderNames

      public String[] getFolderNames(String folderPath) throws IOException
      Description copied from interface: FileSystem
      Return a list of subfolders (by name) that are stored within the specified folder path.
      Throws:
      IOException - if IO error occurs.
    • createFolder

      public void createFolder(String parentPath, String folderName) throws InvalidNameException, IOException
      Description copied from interface: FileSystem
      Creates a new subfolder within the specified parent folder.
      Parameters:
      parentPath - folder path of parent
      folderName - name of new subfolder
      Throws:
      InvalidNameException - if the name does not have all alphanumerics
      IOException - thrown if an IO error occurs.
    • deleteFolder

      public void deleteFolder(String folderPath) throws IOException
      Description copied from interface: FileSystem
      Delete the specified folder.
      Parameters:
      folderPath - path of folder to be deleted
      Throws:
      IOException - if error occurred during delete.
    • moveFolder

      public void moveFolder(String parentPath, String folderName, String newParentPath) throws InvalidNameException, IOException
      Description copied from interface: FileSystem
      Move the specified folder to the path specified by newFolderPath. The moved folder must not be an ancestor of the new Parent.
      Parameters:
      parentPath - path of parent folder that the moving folder currently resides in.
      folderName - name of the folder within the parentPath to be moved.
      newParentPath - path to where the folder is to be moved.
      Throws:
      InvalidNameException - if the new FolderPath contains an illegal file name.
      IOException - if an IO error occurs.
    • renameFolder

      public void renameFolder(String parentPath, String folderName, String newFolderName) throws InvalidNameException, IOException
      Description copied from interface: FileSystem
      Renames the specified folder to a new name.
      Parameters:
      parentPath - the parent folder of the folder to be renamed.
      folderName - the current name of the folder to be renamed.
      newFolderName - the name the folder to be renamed to.
      Throws:
      InvalidNameException - if the new FolderName contains an illegal file name.
      IOException - if an IO error occurs.
    • folderExists

      public boolean folderExists(String folderPath)
      Description copied from interface: FileSystem
      Returns true if the folder specified by the path exists.
      Specified by:
      folderExists in interface FileSystem
      Specified by:
      folderExists in class LocalFileSystem
      Parameters:
      folderPath - the name of the folder to check for existence.
      Returns:
      true if the folder exists.
    • migrationInProgress

      public boolean migrationInProgress()
      Overrides:
      migrationInProgress in class LocalFileSystem
    • convertToIndexedLocalFileSystem

      public void convertToIndexedLocalFileSystem() throws IOException
      Convert this mangled filesystem to an indexed filesystem. This instance should be discarded and not used once the conversion has completed.
      Throws:
      IOException