Class ExtensionDetails
- java.lang.Object
-
- ghidra.framework.plugintool.dialog.ExtensionDetails
-
- All Implemented Interfaces:
java.lang.Comparable<ExtensionDetails>
public class ExtensionDetails extends java.lang.Object implements java.lang.Comparable<ExtensionDetails>
Representation of a Ghidra extension. This class encapsulates all information required to uniquely identify an extension and where (or if) it has been installed.Note that hashCode and equals have been implemented for this. Two extension descriptions are considered equal if they have the same
name
attribute; all other fields are unimportant save for display purposes.
-
-
Constructor Summary
Constructors Constructor Description ExtensionDetails(java.lang.String name, java.lang.String description, java.lang.String author, java.lang.String createdOn, java.lang.String version)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(ExtensionDetails other)
boolean
equals(java.lang.Object obj)
java.lang.String
getArchivePath()
Returns the location where the extension archive is located.java.lang.String
getAuthor()
java.lang.String
getCreatedOn()
java.lang.String
getDescription()
java.lang.String
getInstallPath()
Returns the location where this extension is installed.java.lang.String
getName()
java.lang.String
getVersion()
int
hashCode()
boolean
isInstalled()
An extension is known to be installed if it has a valid installation path AND that path contains a Module.manifest file.void
setArchivePath(java.lang.String path)
void
setAuthor(java.lang.String author)
void
setCreatedOn(java.lang.String date)
void
setDescription(java.lang.String description)
void
setInstallPath(java.lang.String path)
void
setName(java.lang.String name)
void
setVersion(java.lang.String version)
-
-
-
Constructor Detail
-
ExtensionDetails
public ExtensionDetails(java.lang.String name, java.lang.String description, java.lang.String author, java.lang.String createdOn, java.lang.String version)
Constructor.- Parameters:
name
- unique name of the extension; cannot be nulldescription
- brief explanation of what the extension does; can be nullauthor
- creator of the extension; can be nullcreatedOn
- creation date of the extension, can be nullversion
- the extension version
-
-
Method Detail
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
getInstallPath
public java.lang.String getInstallPath()
Returns the location where this extension is installed. If the extension is not installed this will be null.- Returns:
- the extension path, or null
-
setInstallPath
public void setInstallPath(java.lang.String path)
-
getArchivePath
public java.lang.String getArchivePath()
Returns the location where the extension archive is located. If there is no archive this will be null.- Returns:
- the archive path, or null
-
setArchivePath
public void setArchivePath(java.lang.String path)
-
getName
public java.lang.String getName()
-
setName
public void setName(java.lang.String name)
-
getDescription
public java.lang.String getDescription()
-
setDescription
public void setDescription(java.lang.String description)
-
getAuthor
public java.lang.String getAuthor()
-
setAuthor
public void setAuthor(java.lang.String author)
-
getCreatedOn
public java.lang.String getCreatedOn()
-
setCreatedOn
public void setCreatedOn(java.lang.String date)
-
getVersion
public java.lang.String getVersion()
-
setVersion
public void setVersion(java.lang.String version)
-
isInstalled
public boolean isInstalled()
An extension is known to be installed if it has a valid installation path AND that path contains a Module.manifest file.Note: The module manifest file is a marker that indicates several things; one of which is the installation status of an extension. When a user marks an extension to be uninstalled (by checking the appropriate checkbox in the
ExtensionTableModel
), the only thing that is done is to remove this manifest file, which tells theExtensionTableProvider
to remove the entire extension directory on the next launch.- Returns:
- true if the extension is installed.
-
compareTo
public int compareTo(ExtensionDetails other)
- Specified by:
compareTo
in interfacejava.lang.Comparable<ExtensionDetails>
-
-