Package ghidra.app.script

# Class GhidraScriptProperties

java.lang.Object
ghidra.app.script.GhidraScriptProperties

public class GhidraScriptProperties extends Object
Handles processing for .properties files associated with a GhidraScript (.properties file and script should share the same basename).

This should only be called/used by the GhidraScript class.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected void`
  `clearProperties()`
  `boolean`
  `containsKey(String keyString)`
  `boolean`
  `containsValue(String valueString)`
  `String`
  `getFilename()`
  `String`
  `getValue(String keyString)`
  `boolean`
  `isEmpty()`
  `Set<String>`
  `keySet()`
  `protected void`
  `loadGhidraScriptProperties(ResourceFile file)`
  Load a .properties file.
  `protected void`
  `loadGhidraScriptProperties(ResourceFile scriptLocation, String newBaseName)`
  Load a .properties file given a directory (ResourceFile) and the basename (i.e., name of the GhidraScript without the extension).
  `protected void`
  `loadGhidraScriptProperties(List<ResourceFile> possibleLocations, String newBaseName)`
  Look for a .properties file corresponding to the basename in the given locations.
  `protected String`
  `put(String key, String value)`
  `protected String`
  `remove(String keyString)`
  Remove the named property
  `protected Collection<String>`
  `values()`

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

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

- ## Method Details

  - ### loadGhidraScriptProperties

    protected void loadGhidraScriptProperties(ResourceFile scriptLocation, String newBaseName) throws IOException
    Load a .properties file given a directory (ResourceFile) and the basename (i.e., name of the GhidraScript without the extension).
    Parameters:
      `scriptLocation` - location of the GhidraScript
      `newBaseName` - name of the GhidraScript (without the extension)
    Throws:
      `IOException` - if there is an exception loading the properties file

  - ### getFilename

    public String getFilename()
    Returns:
      the properties file name

  - ### loadGhidraScriptProperties

    protected void loadGhidraScriptProperties(List<ResourceFile> possibleLocations, String newBaseName) throws IOException
    Look for a .properties file corresponding to the basename in the given locations.
    Parameters:
      `possibleLocations` - possible locations where the .properties file can be found
      `newBaseName` - name of the GhidraScript (without the extension)
    Throws:
      `IOException` - if there is an exception loading the properties file

  - ### loadGhidraScriptProperties

    protected void loadGhidraScriptProperties(ResourceFile file) throws IOException
    Load a .properties file.
    Parameters:
      `file` - the .properties file
    Throws:
      `IOException` - if there is an exception loading the properties file

  - ### put

    protected String put(String key, String value)

  - ### getValue

    public String getValue(String keyString)
    Parameters:
      `keyString` - the property name
    Returns:
      the value of the key in the properties file, or an empty string if no property exists

  - ### isEmpty

    public boolean isEmpty()
    Returns:
      true if there are no properties

  - ### remove

    protected String remove(String keyString)
    Remove the named property
    Parameters:
      `keyString` - the property name
    Returns:
      the previous value or null

  - ### clearProperties

    protected void clearProperties()

  - ### containsKey

    public boolean containsKey(String keyString)
    Parameters:
      `keyString` - a property name
    Returns:
      true if the key exists in the property file

  - ### containsValue

    public boolean containsValue(String valueString)
    Parameters:
      `valueString` - a value string
    Returns:
      true if any property has the given value

  - ### keySet

    public Set<String> keySet()
    Returns:
      the property names for all properties

  - ### values

    protected Collection<String> values()