Class ApplicationUtilities

java.lang.Object
utility.application.ApplicationUtilities

public class ApplicationUtilities extends Object
Utility class for default application things.
  • Field Details

    • PROPERTY_TEMP_DIR

      public static final String PROPERTY_TEMP_DIR
      Name of system property used to override the location of the user temporary directory
      See Also:
    • PROPERTY_CACHE_DIR

      public static final String PROPERTY_CACHE_DIR
      Name of system property used to override the location of the user cache directory
      See Also:
    • PROPERTY_SETTINGS_DIR

      public static final String PROPERTY_SETTINGS_DIR
      Name of system property used to override the location of the user settings directory
      See Also:
  • Constructor Details

    • ApplicationUtilities

      public ApplicationUtilities()
  • Method Details

    • findDefaultApplicationRootDirs

      public static Collection<ResourceFile> findDefaultApplicationRootDirs()
      Searches for default application root directories.
      Returns:
      A collection of discovered application root directories (could be empty).
    • getDefaultUserTempDir

      public static File getDefaultUserTempDir(String applicationName) throws FileNotFoundException, IOException
      Gets the application's default user temp directory.

      NOTE: This method creates the directory if it does not exist.

      Parameters:
      applicationName - The application name.
      Returns:
      The application's default user temp directory. The returned File will represent an absolute path.
      Throws:
      FileNotFoundException - if the absolute path of the user temp directory could not be determined.
      IOException - if the user temp directory could not be created.
    • getDefaultUserCacheDir

      public static File getDefaultUserCacheDir(ApplicationProperties applicationProperties) throws FileNotFoundException, IOException
      Gets the application's default user cache directory.

      NOTE: This method creates the directory if it does not exist.

      Parameters:
      applicationProperties - The application properties.
      Returns:
      The application's default user cache directory. The returned File will represent an absolute path.
      Throws:
      FileNotFoundException - if the absolute path of the user cache directory could not be determined.
      IOException - if the user cache directory could not be created.
    • getDefaultUserSettingsDir

      public static File getDefaultUserSettingsDir(ApplicationProperties applicationProperties, ResourceFile installationDirectory) throws FileNotFoundException, IOException
      Gets the application's default user settings directory.

      NOTE: This method creates the directory if it does not exist.

      Parameters:
      applicationProperties - The application properties.
      installationDirectory - The application installation directory.
      Returns:
      The application's default user settings directory. The returned File will represent an absolute path.
      Throws:
      FileNotFoundException - if the absolute path of the user settings directory could not be determined.
      IOException - if the user settings directory could not be created.
    • getLegacyUserSettingsDir

      public static File getLegacyUserSettingsDir(ApplicationProperties applicationProperties, ResourceFile installationDirectory) throws FileNotFoundException
      Gets the application's legacy (pre-Ghida 11.1) user settings directory.

      NOTE: This method does not create the directory.

      Parameters:
      applicationProperties - The application properties.
      installationDirectory - The application installation directory.
      Returns:
      The application's legacy user settings directory. The returned File will represent an absolute path.
      Throws:
      FileNotFoundException - if the absolute path of the legacy user settings directory could not be determined.
    • normalizeApplicationName

      public static String normalizeApplicationName(String applicationName)
      Normalizes the application name by removing spaces and converting to lower case
      Parameters:
      applicationName - The application name
      Returns:
      The normalized application name