Package utility.application
Class ApplicationLayout
java.lang.Object
utility.application.ApplicationLayout
- Direct Known Subclasses:
DummyApplicationLayout
,GenericApplicationLayout
,GhidraApplicationLayout
The 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_PROPERTY
should be incremented so
external things like Eclipse GhidraDev know to look in different places for things.
-
Field Summary
Modifier and TypeFieldDescriptionprotected ResourceFile
protected ApplicationProperties
protected Collection
<ResourceFile> protected ResourceFile
protected List
<ResourceFile> protected ResourceFile
protected File
protected File
protected File
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal ResourceFile
Gets the application installation directory from the application layout.final ApplicationProperties
Gets the application properties from the application layoutfinal Collection
<ResourceFile> Gets the application root directories from the application layout.final ResourceFile
Returns the directory where archived application Extensions are stored.final List
<ResourceFile> Returns a prioritizedordered list
of the application Extensions installation directories.Gets the application's modules from the application layout.final ResourceFile
Returns the location of the application patch directory.final File
Gets the user cache directory from the application layout.final File
Gets the user settings directory from the application layout.final File
Gets the user temp directory from the application layout.boolean
Checks whether or not the application is using a "single jar" layout.
-
Field Details
-
applicationProperties
-
applicationRootDirs
-
applicationInstallationDir
-
modules
-
userTempDir
-
userCacheDir
-
userSettingsDir
-
patchDir
-
extensionArchiveDir
-
extensionInstallationDirs
-
-
Constructor Details
-
ApplicationLayout
public ApplicationLayout()
-
-
Method Details
-
getApplicationProperties
Gets the application properties from the application layout- Returns:
- The application properties. Should never be null.
-
getApplicationRootDirs
Gets the application root directories from the application layout.- Returns:
- A collection of application root directories (or null if not set).
-
getApplicationInstallationDir
Gets the application installation directory from the application layout.- Returns:
- The application installation directory (or null if not set).
-
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
Gets the user temp directory from the application layout.- Returns:
- The user temp directory (or null if not set).
-
getUserCacheDir
Gets the user cache directory from the application layout.- Returns:
- The user cache directory (or null if not set).
-
getUserSettingsDir
Gets the user settings directory from the application layout.- Returns:
- The user settings directory (or null if not set).
-
getExtensionArchiveDir
Returns the directory where archived application Extensions are stored. This directory may contain both zip files and subdirectories. This directory is only used inside of an installation; development mode does not use this directory. This directory is used to ship pre-built Ghidra extensions as part of a distribution.This should be at the following location:
{install dir}/Extensions/Ghidra
- Returns:
- the application Extensions archive directory. Could be null if the
ApplicationLayout
does not support application Extensions.
-
getExtensionInstallationDirs
Returns a prioritizedordered list
of the application Extensions installation directories. Typically, the values may be any of the following locations:
[user settings dir]/Extensions
[application install dir]/Ghidra/Extensions
(Release Mode)ghidra/Ghidra/Extensions
(Development Mode)
- Returns:
- an
ordered list
of the application Extensions installation directories. Could be empty if theApplicationLayout
does not support application Extensions.
-
getPatchDir
Returns the location of the application patch directory. The patch directory can be used to modify existing code within a distribution.- Returns:
- the patch directory; may be null
-
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.
-