Package utility.application
Class ApplicationLayout
- java.lang.Object
-
- utility.application.ApplicationLayout
-
- Direct Known Subclasses:
DockingApplicationLayout,DummyApplicationLayout,GhidraApplicationLayout
public abstract class ApplicationLayout extends java.lang.ObjectThe Application Layout base class defines the customizable elements of the application's directory structure. Create a subclass to define a custom layout.If a layout changes in a significant way, the
ApplicationProperties.APPLICATION_LAYOUT_VERSION_PROPERTYshould be incremented so external things like Eclipse GhidraDev know to look in different places for things.
-
-
Field Summary
Fields Change Modifier and Type Field Description NEW protected ResourceFileapplicationInstallationDirNEW protected ApplicationPropertiesapplicationPropertiesNEW protected java.util.Collection<ResourceFile>applicationRootDirsNEW protected ResourceFileextensionArchiveDirNEW protected ResourceFileextensionInstallationDirNEW protected java.util.Map<java.lang.String,GModule>modulesNEW protected java.io.FileuserCacheDirNEW protected java.io.FileuserSettingsDirNEW protected java.io.FileuserTempDir
-
Constructor Summary
Constructors Change Constructor Description ApplicationLayout()
-
Method Summary
All Methods Instance Methods Concrete Methods Change Modifier and Type Method Description voidcreateUserDirs()Creates the application's user directories (or ensures they already exist).ResourceFilegetApplicationInstallationDir()Gets the application installation directory from the application layout.ApplicationPropertiesgetApplicationProperties()Gets the application properties from the application layoutjava.util.Collection<ResourceFile>getApplicationRootDirs()Gets the application root directories from the application layout.ResourceFilegetExtensionArchiveDir()Returns the directory where archived Ghidra Extensions are stored.ResourceFilegetExtensionInstallationDir()Returns the Ghidra Extensions installation folder.java.util.Map<java.lang.String,GModule>getModules()Gets the application's modules from the application layout.java.io.FilegetUserCacheDir()Gets the user cache directory from the application layout.java.io.FilegetUserSettingsDir()Gets the user settings directory from the application layout.java.io.FilegetUserTempDir()Gets the user temp directory from the application layout.booleaninSingleJarMode()Checks whether or not the application is using a "single jar" layout.
-
-
-
Field Detail
-
applicationProperties NEW
protected ApplicationProperties applicationProperties
-
applicationRootDirs NEW
protected java.util.Collection<ResourceFile> applicationRootDirs
-
applicationInstallationDir NEW
protected ResourceFile applicationInstallationDir
-
modules NEW
protected java.util.Map<java.lang.String,GModule> modules
-
extensionArchiveDir NEW
protected ResourceFile extensionArchiveDir
Constructor Detail
-
ApplicationLayout
public ApplicationLayout()
-
-
Method Detail
-
getApplicationProperties
public final ApplicationProperties getApplicationProperties()
Gets the application properties from the application layout- Returns:
- The application properties. Should never be null.
-
getApplicationRootDirs
public final java.util.Collection<ResourceFile> getApplicationRootDirs()
Gets the application root directories from the application layout.- Returns:
- A collection of application root directories (or null if not set).
-
getApplicationInstallationDir
public final ResourceFile getApplicationInstallationDir()
Gets the application installation directory from the application layout.- Returns:
- The application installation directory (or null if not set).
-
getModules
public final java.util.Map<java.lang.String,GModule> getModules()
Gets the application's modules from the application layout.- Returns:
- The application's modules as a map (mapping module name to module for convenience).
-
getUserTempDir
public final java.io.File getUserTempDir()
Gets the user temp directory from the application layout.- Returns:
- The user temp directory (or null if not set).
-
getUserCacheDir
public final java.io.File getUserCacheDir()
Gets the user cache directory from the application layout.- Returns:
- The user cache directory (or null if not set).
-
getUserSettingsDir
public final java.io.File getUserSettingsDir()
Gets the user settings directory from the application layout.- Returns:
- The user settings directory (or null if not set).
-
getExtensionArchiveDir
public final ResourceFile getExtensionArchiveDir()
Returns the directory where archived Ghidra Extensions are stored.- Returns:
- The Ghidra Extensions archive directory. Could be null if the
ApplicationLayoutdoes not support Ghidra Extensions.
-
getExtensionInstallationDir
public final ResourceFile getExtensionInstallationDir()
Returns the Ghidra Extensions installation folder.- Returns:
- The Ghidra Extensions installation directory. Could be null if the
ApplicationLayoutdoes not support Ghidra Extensions.
-
createUserDirs
public final void createUserDirs() throws java.io.IOExceptionCreates the application's user directories (or ensures they already exist).- Throws:
java.io.IOException- if there was a problem creating the application's user directories.
-
inSingleJarMode
public boolean inSingleJarMode()
Checks whether or not the application is using a "single jar" layout. Custom application layouts that extend this class can override this method once they determine they are in single jar mode.- Returns:
- true if the application is using a "single jar" layout; otherwise, false.
-
-