Package ghidra.formats.gfilesystem

# Class FileCacheNameIndex

java.lang.Object
ghidra.formats.gfilesystem.FileCacheNameIndex

public class FileCacheNameIndex extends Object
A best-effort cache of MD5 values of files, where the file is identified by its parent's MD5 combined with the file's path inside its parent's 'namespace'.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `FileCacheNameIndex()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `add(String parentMD5, String name, String fileMD5)`
  Adds a filename mapping to this cache.
  `void`
  `clear()`
  `String`
  `get(String parentMD5, String name)`
  Retrieves a filename mapping from this cache.

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

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

- ## Constructor Details

  - ### FileCacheNameIndex

    public FileCacheNameIndex()

- ## Method Details

  - ### clear

    public void clear()

  - ### add

    public void add(String parentMD5, String name, String fileMD5) throws IOException
    Adds a filename mapping to this cache.
    Parameters:
      `parentMD5` - the md5 string of the parent object
      `name` - the name of this object
      `fileMD5` - the md5 string of this object
    Throws:
      `IOException` - if missing or bad md5 values.

  - ### get

    public String get(String parentMD5, String name) throws IOException
    Retrieves a filename mapping from this cache.
    Parameters:
      `parentMD5` - the md5 string of the parent object
      `name` - the name of the requested object.
    Returns:
      the md5 string of the requested object, or null if not in cache.
    Throws:
      `IOException` - if missing or bad parent md5 values.