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 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)