Package ghidra
Class GhidraApplicationLayout
- java.lang.Object
-
- utility.application.ApplicationLayout
-
- ghidra.GhidraApplicationLayout
-
- Direct Known Subclasses:
GhidraJarApplicationLayout
,GhidraTestApplicationLayout
public class GhidraApplicationLayout extends ApplicationLayout
The Ghidra application layout defines the customizable elements of the Ghidra application's directory structure.
-
-
Field Summary
-
Fields inherited from class utility.application.ApplicationLayout
applicationInstallationDir, applicationProperties, applicationRootDirs, extensionArchiveDir, extensionInstallationDirs, modules, patchDir, userCacheDir, userSettingsDir, userTempDir
-
-
Constructor Summary
Constructors Constructor Description GhidraApplicationLayout()
Constructs a new Ghidra application layout object.GhidraApplicationLayout(java.io.File applicationInstallationDir)
Constructs a new Ghidra application layout object using a provided application installation directory instead of this layout's default.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ResourceFile
findExtensionArchiveDirectory()
Returns the directory where all Ghidra extension archives are stored.protected java.util.List<ResourceFile>
findExtensionInstallationDirectories()
Returns a prioritized list of directories where Ghidra extensions are installed.protected ResourceFile
findGhidraApplicationInstallationDir()
Finds the application installation directory for this Ghidra application layout.protected java.util.Collection<ResourceFile>
findGhidraApplicationRootDirs()
Finds the application root directories for this application layout.protected java.util.Map<java.lang.String,GModule>
findGhidraModules()
Finds the modules for this Ghidra application layout.protected ResourceFile
findPatchDirectory()
Returns the directory that allows users to add jar and class files to override existing distribution files-
Methods inherited from class utility.application.ApplicationLayout
createUserDirs, getApplicationInstallationDir, getApplicationProperties, getApplicationRootDirs, getExtensionArchiveDir, getExtensionInstallationDirs, getModules, getPatchDir, getUserCacheDir, getUserSettingsDir, getUserTempDir, inSingleJarMode
-
-
-
-
Constructor Detail
-
GhidraApplicationLayout
public GhidraApplicationLayout() throws java.io.FileNotFoundException, java.io.IOException
Constructs a new Ghidra application layout object.- Throws:
java.io.FileNotFoundException
- if there was a problem getting a user directory.java.io.IOException
- if there was a problem getting the application properties or modules.
-
GhidraApplicationLayout
public GhidraApplicationLayout(java.io.File applicationInstallationDir) throws java.io.FileNotFoundException, java.io.IOException
Constructs a new Ghidra application layout object using a provided application installation directory instead of this layout's default.This is used when something external to Ghidra needs Ghidra's layout (like the Eclipse GhidraDevPlugin).
- Parameters:
applicationInstallationDir
- The application installation directory.- Throws:
java.io.FileNotFoundException
- if there was a problem getting a user directory.java.io.IOException
- if there was a problem getting the application properties.
-
-
Method Detail
-
findGhidraApplicationRootDirs
protected java.util.Collection<ResourceFile> findGhidraApplicationRootDirs()
Finds the application root directories for this application layout.- Returns:
- A collection of the application root directories for this layout.
-
findGhidraApplicationInstallationDir
protected ResourceFile findGhidraApplicationInstallationDir()
Finds the application installation directory for this Ghidra application layout.- Returns:
- The application installation directory for this Ghidra application layout. Could be null if there is no application installation directory.
-
findGhidraModules
protected java.util.Map<java.lang.String,GModule> findGhidraModules() throws java.io.IOException
Finds the modules for this Ghidra application layout.- Returns:
- The modules for this Ghidra application layout.
- Throws:
java.io.IOException
- if there was a problem finding the modules on disk.
-
findPatchDirectory
protected ResourceFile findPatchDirectory()
Returns the directory that allows users to add jar and class files to override existing distribution files- Returns:
- the patch dir; null if not in a distribution
-
findExtensionArchiveDirectory
protected ResourceFile findExtensionArchiveDirectory()
Returns the directory where all Ghidra extension archives are stored. This should be at the following location:
[application root]/Extensions/Ghidra
- Returns:
- the archive folder, or null if can't be determined
-
findExtensionInstallationDirectories
protected java.util.List<ResourceFile> findExtensionInstallationDirectories()
Returns a prioritized list of directories where Ghidra extensions are installed. These should be at the following locations:
[user settings dir]/Extensions
[application install dir]/Ghidra/Extensions
ghidra/Ghidra/Extensions
(development mode)
- Returns:
- the install folder, or null if can't be determined
-
-