Package ghidra.framework.store.local

# Class IndexedV1LocalFileSystem

java.lang.Object
ghidra.framework.store.local.LocalFileSystem
ghidra.framework.store.local.IndexedLocalFileSystem
ghidra.framework.store.local.IndexedV1LocalFileSystem

All Implemented Interfaces:
  `FileSystem`

public class IndexedV1LocalFileSystem extends IndexedLocalFileSystem
`IndexedV1LocalFileSystem` implements a case-sensitive indexed filesystem which uses a shallow storage hierarchy with no restriction on file name or path length. This filesystem is identified by the existence of an index file (~index.dat) and recovery journal (~index.jrn). File system also maintains a file-ID mapping.

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from class ghidra.framework.store.local.IndexedLocalFileSystem

  `IndexedLocalFileSystem.BadStorageNameException, IndexedLocalFileSystem.IndexReadException, IndexedLocalFileSystem.IndexVersionException`

  ## Nested classes/interfaces inherited from class ghidra.framework.store.local.LocalFileSystem

  `LocalFileSystem.ItemStorage`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final int`
  `INDEX_VERSION`

  ### Fields inherited from class ghidra.framework.store.local.IndexedLocalFileSystem

  `INDEX_ITEM_INDENT, INDEX_ITEM_SEPARATOR, LATEST_INDEX_VERSION`

  ### Fields inherited from class ghidra.framework.store.local.LocalFileSystem

  `eventManager, HIDDEN_DIR_PREFIX, HIDDEN_DIR_PREFIX_CHAR, HIDDEN_ITEM_PREFIX, isVersioned, readOnly, root`

  ### Fields inherited from interface ghidra.framework.store.FileSystem

  `SEPARATOR, SEPARATOR_CHAR`

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `IndexedV1LocalFileSystem(String rootPath, boolean isVersioned, boolean readOnly, boolean enableAsyncronousDispatching, boolean create)`
  Constructor.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected void`
  `fileIdChanged(ItemPropertyFile pfile, String oldFileId)`
  Notification that FileID has been changed within propertyFile
  `int`
  `getIndexImplementationVersion()`
  `LocalFolderItem`
  `getItem(String fileID)`
  Returns the FolderItem specified by its unique File-ID
  `static boolean`
  `rebuild(File rootDir)`
  Completely rebuild filesystem index using item information contained within indexed property files.

  ### Methods inherited from class ghidra.framework.store.local.IndexedLocalFileSystem

  `allocateItemStorage, createFolder, deallocateItemStorage, deleteFolder, dispose, findItemStorage, folderExists, getFolderNames, getItemCount, getItemNames, getItems, getMaxNameLength, hasIndexedStructure, isIndexed, itemDeleted, moveFolder, moveItem, readIndexVersion, renameFolder`

  ### Methods inherited from class ghidra.framework.store.local.LocalFileSystem

  `addFileSystemListener, checkDisposed, cleanupAfterConstruction, createDatabase, createDatabase, createDataFile, createFile, createTemporaryDatabase, createTextDataItem, deleteEmptyVersionedFolders, escapeHiddenDirPrefixChars, fileExists, getItem, getItemNames, getLocalFileSystem, getName, getParentPath, getPath, getUserName, isHiddenDirName, isOnline, isReadOnly, isRefreshRequired, isShared, isSupportedItemType, isValidNameCharacter, isVersioned, log, migrationInProgress, removeFileSystemListener, setAssociatedRepositoryLogger, setValidationRequired, testValidName, unescapeHiddenDirPrefixChars`

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

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### INDEX_VERSION

    public static final int INDEX_VERSION
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### IndexedV1LocalFileSystem

    protected IndexedV1LocalFileSystem(String rootPath, boolean isVersioned, boolean readOnly, boolean enableAsyncronousDispatching, boolean create) throws IOException
    Constructor.
    Parameters:
      `rootPath` - path for root directory.
      `isVersioned` - if true item versioning will be enabled.
      `readOnly` - if true modifications within this file-system will not be allowed and result in an ReadOnlyException
      `enableAsyncronousDispatching` - if true a separate dispatch thread will be used to notify listeners. If false, blocking notification will be performed.
      `create` - if true a new folder will be created.
    Throws:
      `FileNotFoundException` - if specified rootPath does not exist
      `IndexedLocalFileSystem.IndexReadException` - failure occured reading index file
      `IOException` - if error occurs while reading/writing index files

- ## Method Details

  - ### getIndexImplementationVersion

    public int getIndexImplementationVersion()
    Overrides:
      `getIndexImplementationVersion` in class `IndexedLocalFileSystem`

  - ### fileIdChanged

    protected void fileIdChanged(ItemPropertyFile pfile, String oldFileId) throws IOException
    Description copied from class: `LocalFileSystem`
    Notification that FileID has been changed within propertyFile
    Overrides:
      `fileIdChanged` in class `LocalFileSystem`
    Parameters:
      `pfile` - item property file
      `oldFileId` - old FileId
    Throws:
      `IOException` - if an IO error occurs

  - ### getItem

    public LocalFolderItem getItem(String fileID) throws IOException, UnsupportedOperationException
    Description copied from interface: `FileSystem`
    Returns the FolderItem specified by its unique File-ID
    Specified by:
      `getItem` in interface `FileSystem`
    Overrides:
      `getItem` in class `LocalFileSystem`
    Parameters:
      `fileID` - the items unique file ID
    Returns:
      the FolderItem with the given folderPath and name, or null if it doesn't exist.
    Throws:
      `IOException` - if IO error occurs.
      `UnsupportedOperationException` - if file-system does not support this operation

  - ### rebuild

    public static boolean rebuild(File rootDir) throws IOException
    Completely rebuild filesystem index using item information contained within indexed property files. Empty folders will be lost.
    Parameters:
      `rootDir` -
    Throws:
      `IOException`