Package utility.application
Class ApplicationUtilities
java.lang.Object
utility.application.ApplicationUtilities
Utility class for default application things.
-
Field Summary
FieldsChangeModifier and TypeFieldDescriptionNEWstatic final StringName of system property used to override the location of the user cache directoryNEWstatic final StringName of system property used to override the location of the user settings directoryNEWstatic final StringName of system property used to override the location of the user temporary directory -
Constructor Summary
Constructors -
Method Summary
ChangeModifier and TypeMethodDescriptionstatic Collection<ResourceFile>Searches for default application root directories.MODIFIEDstatic FilegetDefaultUserCacheDir(ApplicationProperties applicationProperties) Gets the application's default user cache directory.MODIFIEDstatic FilegetDefaultUserSettingsDir(ApplicationProperties applicationProperties, ResourceFile installationDirectory) Gets the application's default user settings directory.NEWstatic FilegetDefaultUserTempDir(String applicationName) Gets the application's default user temp directory.NEWstatic FilegetLegacyUserSettingsDir(ApplicationProperties applicationProperties, ResourceFile installationDirectory) Gets the application's legacy (pre-Ghida 11.1) user settings directory.NEWstatic StringnormalizeApplicationName(String applicationName) Normalizes the application name by removing spaces and converting to lower caseREMOVEDFilegetDefaultUserTempDir(ApplicationProperties applicationProperties) Removed
-
Field Details
-
PROPERTY_TEMP_DIR NEW
Name of system property used to override the location of the user temporary directory- See Also:
-
PROPERTY_CACHE_DIR NEW
Name of system property used to override the location of the user cache directory- See Also:
-
PROPERTY_SETTINGS_DIR NEW
Name of system property used to override the location of the user settings directory- See Also:
-
-
Constructor Details
-
ApplicationUtilities
public ApplicationUtilities()
-
-
Method Details
-
findDefaultApplicationRootDirs
Searches for default application root directories.- Returns:
- A collection of discovered application root directories (could be empty).
-
getDefaultUserTempDir NEW
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
Filewill 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 MODIFIED
public static File getDefaultUserCacheDir(ApplicationProperties applicationProperties) throws FileNotFoundException, IOException added throws IOException-static java.io.File getDefaultUserCacheDir(ghidra.framework.ApplicationProperties applicationProperties) throws FileNotFoundException+static java.io.File getDefaultUserCacheDir(ghidra.framework.ApplicationProperties applicationProperties) throws FileNotFoundException, IOExceptionGets 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
Filewill 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 MODIFIED
public static File getDefaultUserSettingsDir(ApplicationProperties applicationProperties, ResourceFile installationDirectory) throws FileNotFoundException, IOException added throws IOException-static java.io.File getDefaultUserSettingsDir(ghidra.framework.ApplicationProperties applicationProperties, generic.jar.ResourceFile installationDirectory) throws FileNotFoundException+static java.io.File getDefaultUserSettingsDir(ghidra.framework.ApplicationProperties applicationProperties, generic.jar.ResourceFile installationDirectory) throws FileNotFoundException, IOExceptionGets 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
Filewill 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 NEW
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
Filewill represent an absolute path. - Throws:
FileNotFoundException- if the absolute path of the legacy user settings directory could not be determined.
-
normalizeApplicationName NEW
Normalizes the application name by removing spaces and converting to lower case- Parameters:
applicationName- The application name- Returns:
- The normalized application name
-