Package ghidra.util.extensions

# Class ExtensionUtils

java.lang.Object
ghidra.util.extensions.ExtensionUtils

public class ExtensionUtils extends Object
Utilities for finding extensions.

Extension searching is cached. Use `reload()` to update the cache.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static String`
  `PROPERTIES_FILE_NAME`
  `static String`
  `PROPERTIES_FILE_NAME_UNINSTALLED`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ExtensionUtils()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static void`
  `clearCache()`
  Clears any cached extensions.
  `static ExtensionDetails`
  `createExtensionDetailsFromArchive(ResourceFile resourceFile)`
  `static ExtensionDetails`
  `createExtensionFromProperties(File file)`
  `static Set<ExtensionDetails>`
  `getActiveInstalledExtensions()`
  `static Extensions`
  `getAllInstalledExtensions()`
  `static Set<ExtensionDetails>`
  `getArchiveExtensions()`
  Returns all archive extensions.
  `static ExtensionDetails`
  `getExtension(File file, boolean quiet)`
  `static ExtensionDetails`
  `getExtension(String path)`
  `static Set<ExtensionDetails>`
  `getInstalledExtensions()`
  Returns all installed extensions.
  `static void`
  `initializeExtensions()`
  Performs extension maintenance.
  `static boolean`
  `install(ExtensionDetails extension, File file, TaskMonitor monitor)`
  `static boolean`
  `isExtension(File file)`
  Returns true if the given file or directory is a valid ghidra extension.
  `static void`
  `reload()`
  Clears any cached extensions and searches for extensions.

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

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

- ## Field Details

  - ### PROPERTIES_FILE_NAME

    public static String PROPERTIES_FILE_NAME

  - ### PROPERTIES_FILE_NAME_UNINSTALLED

    public static String PROPERTIES_FILE_NAME_UNINSTALLED

- ## Constructor Details

  - ### ExtensionUtils

    public ExtensionUtils()

- ## Method Details

  - ### initializeExtensions

    public static void initializeExtensions()
    Performs extension maintenance. This should be called at startup, before any plugins or extension points are loaded.

  - ### getExtension

    public static ExtensionDetails getExtension(String path)

  - ### isExtension

    public static boolean isExtension(File file)
    Returns true if the given file or directory is a valid ghidra extension.

    Note: This means that the zip or directory contains an extension.properties file.

    Parameters:
      `file` - the zip or directory to inspect
    Returns:
      true if the given file represents a valid extension

  - ### install

    public static boolean install(ExtensionDetails extension, File file, TaskMonitor monitor)

  - ### getActiveInstalledExtensions

    public static Set<ExtensionDetails> getActiveInstalledExtensions()

  - ### getInstalledExtensions

    public static Set<ExtensionDetails> getInstalledExtensions()
    Returns all installed extensions. These are all the extensions found in `ApplicationLayout.getExtensionInstallationDirs()`.
    Returns:
      set of installed extensions

  - ### getAllInstalledExtensions

    public static Extensions getAllInstalledExtensions()

  - ### getExtension

    public static ExtensionDetails getExtension(File file, boolean quiet)

  - ### reload

    public static void reload()
    Clears any cached extensions and searches for extensions.

  - ### clearCache

    public static void clearCache()
    Clears any cached extensions.

  - ### getArchiveExtensions

    public static Set<ExtensionDetails> getArchiveExtensions()
    Returns all archive extensions. These are all the extensions found in `ApplicationLayout.getExtensionArchiveDir()`. This are added to an installation as part of the build processes.

    Archived extensions may be zip files and directories.

    Returns:
      set of archive extensions

  - ### createExtensionFromProperties

    public static ExtensionDetails createExtensionFromProperties(File file)

  - ### createExtensionDetailsFromArchive

    public static ExtensionDetails createExtensionDetailsFromArchive(ResourceFile resourceFile)