Class AddOn
- java.lang.Object
-
- org.zaproxy.zap.control.AddOn
-
public class AddOn extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AddOn.AddOnRunRequirements
The requirements to run anAddOn
.static class
AddOn.BaseRunRequirements
static class
AddOn.BundleData
The data of the bundle declared in the manifest of an add-on.static class
AddOn.ExtensionRunRequirements
The requirements to run anextension
(with add-on dependencies).static class
AddOn.HelpSetData
The data to load aHelpSet
, declared in the manifest of an add-on.static class
AddOn.InstallationStatus
The installation status of the add-on.static class
AddOn.InvalidAddOnException
AnIOException
that indicates that a file is not a valid add-on.static class
AddOn.Status
static class
AddOn.ValidationResult
The result of checking if a file is a valid add-on.
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
FILE_EXTENSION
The file extension of ZAP add-ons.static java.lang.String
MANIFEST_FILE_NAME
The name of the manifest file, contained in the add-ons.
-
Constructor Summary
Constructors Constructor Description AddOn(java.lang.String id, java.io.File baseDir, org.apache.commons.configuration.SubnodeConfiguration xmlData)
Constructs anAddOn
from an add-on entry ofZapVersions.xml
file.AddOn(java.nio.file.Path file)
Constructs anAddOn
from the givenfile
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addLoadedExtension(Extension extension)
Adds the givenextension
to the list of loaded extensions of this add-on.AddOn.AddOnRunRequirements
calculateExtensionInstallRequirements(java.lang.String classname, java.util.Collection<AddOn> availableAddOns)
Calculates the requirements to install/run the givenextension
, same ascalculateExtensionRunRequirements(String, Collection)
but does not require the libraries of the add-ons (this or dependencies) to exist in the file system.AddOn.AddOnRunRequirements
calculateExtensionInstallRequirements(Extension extension, java.util.Collection<AddOn> availableAddOns)
Calculates the requirements to install/run the givenextension
, same ascalculateExtensionRunRequirements(Extension, Collection)
but does not require the libraries of the add-ons (this or dependencies) to exist in the file system.AddOn.AddOnRunRequirements
calculateExtensionRunRequirements(java.lang.String classname, java.util.Collection<AddOn> availableAddOns)
Calculates the requirements to run the extension with the givenclassname
, in the current ZAP and Java versions and with the givenavailableAddOns
.AddOn.AddOnRunRequirements
calculateExtensionRunRequirements(Extension extension, java.util.Collection<AddOn> availableAddOns)
Calculates the requirements to run the givenextension
, in the current ZAP and Java versions and with the givenavailableAddOns
.AddOn.AddOnRunRequirements
calculateInstallRequirements(java.util.Collection<AddOn> availableAddOns)
Calculates the requirements to install/run this add-on, same ascalculateRunRequirements(Collection)
but does not require the libraries of the add-ons (this or dependencies) to exist in the file system.AddOn.AddOnRunRequirements
calculateRunRequirements(java.util.Collection<AddOn> availableAddOns)
Calculates the requirements to run this add-on, in the current ZAP and Java versions and with the givenavailableAddOns
.boolean
canLoadInCurrentVersion()
Tells whether or not this add-on can be loaded in the currently running ZAP version, as given byConstant.PROGRAM_VERSION
.boolean
canLoadInVersion(java.lang.String zapVersion)
Tells whether or not this add-on can be loaded in the givenzapVersion
.boolean
canRunInCurrentJavaVersion()
Tells whether or not this add-on can be run in the currently running Java version.boolean
canRunInJavaVersion(java.lang.String javaVersion)
Tells whether or not this add-on can be run in the givenjavaVersion
.static java.util.Optional<AddOn>
createAddOn(java.nio.file.Path file)
Convenience method that attempts to create anAddOn
from the given file.boolean
dependsOn(java.util.Collection<AddOn> addOns)
Tells whether or not this add-on has a (direct) dependency on any of the givenaddOns
(including version).boolean
dependsOn(Extension extension, AddOn addOn)
Tells whether or not the givenextension
has a (direct) dependency on the givenaddOn
(including version).boolean
dependsOn(AddOn addOn)
Tells whether or not this add-on has a (direct) dependency on the givenaddOn
(including version).boolean
equals(java.lang.Object obj)
Two add-ons are considered equal if both add-ons have the same ID and version.org.zaproxy.zap.control.AddOnClassnames
getAddOnClassnames()
Gets the classnames that can be loaded for the add-on.java.util.List<java.lang.String>
getAscanrules()
java.lang.String
getAuthor()
AddOn.BundleData
getBundleData()
Gets the data of the bundle declared in the manifest.java.lang.String
getChanges()
java.lang.ClassLoader
getClassLoader()
Gets the class loader of the add-on.java.lang.String
getDescription()
org.zaproxy.zap.control.AddOnClassnames
getExtensionAddOnClassnames(java.lang.String classname)
Returns the classnames that can be loaded for the givenExtension
(with dependencies).java.util.List<java.lang.String>
getExtensions()
java.util.List<java.lang.String>
getExtensionsWithDeps()
Returns the classnames ofExtension
sthat have dependencies on add-ons.java.io.File
getFile()
Gets the file of the add-on.java.util.List<java.lang.String>
getFiles()
int
getFileVersion()
Deprecated.(2.7.0) UsegetVersion()
instead.java.lang.String
getHash()
AddOn.HelpSetData
getHelpSetData()
Gets the data for the HelpSet, declared in the manifest.java.lang.String
getId()
java.util.List<java.lang.String>
getIdsAddOnDependencies()
Returns the IDs of the add-ons dependencies, an empty collection if none.java.net.URL
getInfo()
AddOn.InstallationStatus
getInstallationStatus()
Gets installations status of the add-on.java.util.List<AbstractPlugin>
getLoadedAscanrules()
Gets the active scan rules of this add-on that were loaded.java.util.List<Extension>
getLoadedExtensions()
Gets the extensions of this add-on that were loaded.java.util.List<Extension>
getLoadedExtensionsWithDeps()
Gets the extensions of this add-on that have dependencies and were loaded.java.util.List<PluginPassiveScanner>
getLoadedPscanrules()
Gets the passive scan rules of this add-on that were loaded.java.lang.String
getMinimumJavaVersion()
Returns the minimum Java version required to run this add-on or an emptyString
if there's no minimum version.java.lang.String
getName()
java.lang.String
getNormalisedFileName()
Gets the normalised file name of the add-on.java.lang.String
getNotBeforeVersion()
java.lang.String
getNotFromVersion()
java.util.List<java.lang.String>
getPscanrules()
java.lang.String
getReleaseDate()
Gets the date when the add-on was released.java.net.URL
getRepo()
Gets the URL to the browsable repo.java.util.ResourceBundle
getResourceBundle()
Gets the resource bundle of the add-on.long
getSize()
AddOn.Status
getStatus()
java.net.URL
getUrl()
Version
getVersion()
Gets the semantic version of this add-on.boolean
hasExtensionsWithDeps()
Tells whether or not this add-on has at least one extension with dependencies.int
hashCode()
boolean
hasZapAddOnEntry()
static boolean
isAddOn(java.nio.file.Path file)
Tells whether or not the given file is a ZAP add-on.static boolean
isAddOnFileName(java.lang.String fileName)
Tells whether or not the given file name matches the name of a ZAP add-on.boolean
isExtensionLoaded(java.lang.String classname)
Tells whether or not the extension with the givenclassname
is loaded.boolean
isMandatory()
Tells whether or not this add-on is mandatory.boolean
isSameAddOn(AddOn addOn)
boolean
isUpdateTo(AddOn addOn)
static AddOn.ValidationResult
isValidAddOn(java.nio.file.Path file)
Tells whether or not the given file is a ZAP add-on.void
removeLoadedExtension(Extension extension)
Removes the givenextension
from the list of loaded extensions of this add-on.void
setAuthor(java.lang.String author)
void
setChanges(java.lang.String changes)
void
setClassLoader(java.lang.ClassLoader classLoader)
Sets the class loader of the add-on.void
setDescription(java.lang.String description)
void
setFile(java.io.File file)
void
setId(java.lang.String id)
void
setInfo(java.net.URL info)
void
setInstallationStatus(AddOn.InstallationStatus installationStatus)
Sets the installation status of the add-on.void
setMandatory(boolean mandatory)
Sets if this add-on is mandatory.void
setName(java.lang.String name)
void
setNotBeforeVersion(java.lang.String notBeforeVersion)
void
setNotFromVersion(java.lang.String notFromVersion)
void
setResourceBundle(java.util.ResourceBundle resourceBundle)
Sets the resource bundle of the add-on.void
setSize(long size)
void
setStatus(AddOn.Status status)
void
setUrl(java.net.URL url)
java.lang.String
toString()
-
-
-
Field Detail
-
MANIFEST_FILE_NAME
public static final java.lang.String MANIFEST_FILE_NAME
The name of the manifest file, contained in the add-ons.The manifest is expected to be in the root of the ZIP file.
- Since:
- 2.6.0
- See Also:
- Constant Field Values
-
FILE_EXTENSION
public static final java.lang.String FILE_EXTENSION
The file extension of ZAP add-ons.- Since:
- 2.6.0
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AddOn
public AddOn(java.nio.file.Path file) throws java.io.IOException
Constructs anAddOn
from the givenfile
.The "ZapAddOn.xml" ZIP file entry is read after validating that the add-on is a valid add-on.
The installation status of the add-on is 'not installed'.
- Parameters:
file
- the file of the add-on- Throws:
AddOn.InvalidAddOnException
- (since 2.8.0) if the givenfile
does not exist, does not have a valid add-on file name, or an error occurred while reading the add-on manifest ("ZapAddOn.xml").java.io.IOException
- if an error occurred while reading/validating the file.- See Also:
isAddOn(Path)
-
AddOn
public AddOn(java.lang.String id, java.io.File baseDir, org.apache.commons.configuration.SubnodeConfiguration xmlData) throws java.net.MalformedURLException, java.io.IOException
Constructs anAddOn
from an add-on entry ofZapVersions.xml
file. The installation status of the add-on is 'not installed'.The "ZapAddOn.xml" ZIP file entry is read, if the add-on file exists locally.
- Parameters:
id
- the id of the add-onbaseDir
- the base directory where the add-on is locatedxmlData
- the source of add-on entry ofZapVersions.xml
file- Throws:
java.net.MalformedURLException
- if theURL
of the add-on is malformedjava.io.IOException
- if an error occurs while reading the XML data
-
-
Method Detail
-
isAddOnFileName
public static boolean isAddOnFileName(java.lang.String fileName)
Tells whether or not the given file name matches the name of a ZAP add-on.The file name must have as file extension
FILE_EXTENSION
.- Parameters:
fileName
- the name of the file to check- Returns:
true
if the given file name is the name of an add-on,false
otherwise.- Since:
- 2.6.0
-
isAddOn
public static boolean isAddOn(java.nio.file.Path file)
Tells whether or not the given file is a ZAP add-on.An add-on is a ZIP file that contains, at least, a "ZapAddOn.xml" file.
- Parameters:
file
- the file to be checked- Returns:
true
if the given file is an add-on,false
otherwise.- Since:
- 2.6.0
- See Also:
isAddOnFileName(String)
,isValidAddOn(Path)
-
isValidAddOn
public static AddOn.ValidationResult isValidAddOn(java.nio.file.Path file)
Tells whether or not the given file is a ZAP add-on.- Parameters:
file
- the file to be checked.- Returns:
- the result of the validation.
- Since:
- 2.8.0
- See Also:
isAddOn(Path)
-
createAddOn
public static java.util.Optional<AddOn> createAddOn(java.nio.file.Path file)
Convenience method that attempts to create anAddOn
from the given file.A warning is logged if the add-on is invalid and an error if an error occurred while creating it.
- Parameters:
file
- the file of the add-on.- Returns:
- a container with the
AddOn
, or empty if not valid or an error occurred while creating it. - Since:
- 2.8.0
-
getId
public java.lang.String getId()
-
setId
public void setId(java.lang.String id)
-
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)
-
getFileVersion
@Deprecated public int getFileVersion()
Deprecated.(2.7.0) UsegetVersion()
instead.Gets the file version of the add-on.- Returns:
- the file version.
-
getVersion
public Version getVersion()
Gets the semantic version of this add-on.Since 2.7.0, for add-ons that use just an integer as the version it's appended ".0.0", for example, for version 14 it returns the version 14.0.0.
- Returns:
- the semantic version of the add-on, since 2.7.0, never
null
. - Since:
- 2.4.0
-
getStatus
public AddOn.Status getStatus()
-
setStatus
public void setStatus(AddOn.Status status)
-
getChanges
public java.lang.String getChanges()
-
setChanges
public void setChanges(java.lang.String changes)
-
getNormalisedFileName
public java.lang.String getNormalisedFileName()
Gets the normalised file name of the add-on.Should be used when copying the file from an "unknown" source (e.g. manually installed).
- Returns:
- the normalised file name.
- Since:
- 2.6.0
- See Also:
getFile()
-
getFile
public java.io.File getFile()
Gets the file of the add-on.- Returns:
- the file of the add-on.
- See Also:
getNormalisedFileName()
-
setFile
public void setFile(java.io.File file)
-
getUrl
public java.net.URL getUrl()
-
setUrl
public void setUrl(java.net.URL url)
-
getSize
public long getSize()
-
setSize
public void setSize(long size)
-
getAuthor
public java.lang.String getAuthor()
-
setAuthor
public void setAuthor(java.lang.String author)
-
getClassLoader
public java.lang.ClassLoader getClassLoader()
Gets the class loader of the add-on.- Returns:
- the class loader of the add-on,
null
if the add-on is not installed. - Since:
- 2.8.0
-
setClassLoader
public void setClassLoader(java.lang.ClassLoader classLoader)
Sets the class loader of the add-on.Note: This method should be called only by bootstrap classes.
- Parameters:
classLoader
- the class loader of the add-on, might benull
.- Since:
- 2.8.0
-
setInstallationStatus
public void setInstallationStatus(AddOn.InstallationStatus installationStatus)
Sets the installation status of the add-on.- Parameters:
installationStatus
- the new installation status- Throws:
java.lang.IllegalArgumentException
- if the giveninstallationStatus
isnull
.- Since:
- 2.4.0
-
getInstallationStatus
public AddOn.InstallationStatus getInstallationStatus()
Gets installations status of the add-on.- Returns:
- the installation status, never
null
- Since:
- 2.4.0
-
hasZapAddOnEntry
public boolean hasZapAddOnEntry()
-
getAddOnClassnames
public org.zaproxy.zap.control.AddOnClassnames getAddOnClassnames()
Gets the classnames that can be loaded for the add-on.- Returns:
- the classnames that can be loaded
- Since:
- 2.4.3
-
getExtensions
public java.util.List<java.lang.String> getExtensions()
-
getExtensionsWithDeps
public java.util.List<java.lang.String> getExtensionsWithDeps()
Returns the classnames ofExtension
sthat have dependencies on add-ons.- Returns:
- the classnames of the extensions with dependencies on add-ons.
- See Also:
hasExtensionsWithDeps()
-
getExtensionAddOnClassnames
public org.zaproxy.zap.control.AddOnClassnames getExtensionAddOnClassnames(java.lang.String classname)
Returns the classnames that can be loaded for the givenExtension
(with dependencies).- Parameters:
classname
- the classname of the extension- Returns:
- the classnames that can be loaded
- Since:
- 2.4.3
- See Also:
hasExtensionsWithDeps()
-
hasExtensionsWithDeps
public boolean hasExtensionsWithDeps()
Tells whether or not this add-on has at least one extension with dependencies.- Returns:
true
if the add-on has at leas one extension with dependencies,false
otherwise- See Also:
getExtensionsWithDeps()
-
getLoadedExtensionsWithDeps
public java.util.List<Extension> getLoadedExtensionsWithDeps()
Gets the extensions of this add-on that have dependencies and were loaded.- Returns:
- an unmodifiable
List
with the extensions of this add-on that have dependencies and were loaded - Since:
- 2.4.0
-
getLoadedExtensions
public java.util.List<Extension> getLoadedExtensions()
Gets the extensions of this add-on that were loaded.- Returns:
- an unmodifiable
List
with the extensions of this add-on that were loaded - Since:
- 2.4.0
-
addLoadedExtension
public void addLoadedExtension(Extension extension)
Adds the givenextension
to the list of loaded extensions of this add-on.This add-on is set to the given
extension
.- Parameters:
extension
- the extension of this add-on that was loaded- Throws:
java.lang.IllegalArgumentException
- if extension isnull
- Since:
- 2.4.0
- See Also:
removeLoadedExtension(Extension)
,Extension.setAddOn(AddOn)
-
removeLoadedExtension
public void removeLoadedExtension(Extension extension)
Removes the givenextension
from the list of loaded extensions of this add-on.The add-on of the given
extension
is set tonull
.The call to this method has no effect if the given
extension
does not belong to this add-on.- Parameters:
extension
- the loaded extension of this add-on that should be removed- Throws:
java.lang.IllegalArgumentException
- if extension isnull
- Since:
- 2.4.0
- See Also:
addLoadedExtension(Extension)
,Extension.setAddOn(AddOn)
-
getAscanrules
public java.util.List<java.lang.String> getAscanrules()
-
getLoadedAscanrules
public java.util.List<AbstractPlugin> getLoadedAscanrules()
Gets the active scan rules of this add-on that were loaded.- Returns:
- an unmodifiable
List
with the active scan rules of this add-on that were loaded, nevernull
- Since:
- 2.4.3
- See Also:
setLoadedAscanrules(List)
-
getPscanrules
public java.util.List<java.lang.String> getPscanrules()
-
getLoadedPscanrules
public java.util.List<PluginPassiveScanner> getLoadedPscanrules()
Gets the passive scan rules of this add-on that were loaded.- Returns:
- an unmodifiable
List
with the passive scan rules of this add-on that were loaded, nevernull
- Since:
- 2.4.3
- See Also:
setLoadedPscanrules(List)
-
getFiles
public java.util.List<java.lang.String> getFiles()
-
isSameAddOn
public boolean isSameAddOn(AddOn addOn)
-
isUpdateTo
public boolean isUpdateTo(AddOn addOn) throws java.lang.IllegalArgumentException
- Throws:
java.lang.IllegalArgumentException
-
canLoadInCurrentVersion
public boolean canLoadInCurrentVersion()
Tells whether or not this add-on can be loaded in the currently running ZAP version, as given byConstant.PROGRAM_VERSION
.- Returns:
true
if the add-on can be loaded in the currently running ZAP version,false
otherwise- See Also:
canLoadInVersion(String)
,Constant.PROGRAM_VERSION
-
canRunInCurrentJavaVersion
public boolean canRunInCurrentJavaVersion()
Tells whether or not this add-on can be run in the currently running Java version.This is a convenience method that calls
canRunInJavaVersion(String)
with the running Java version (as given bySystemUtils.JAVA_VERSION
) as parameter.- Returns:
true
if the add-on can be run in the currently running Java version,false
otherwise- Since:
- 2.4.0
- See Also:
canRunInJavaVersion(String)
,SystemUtils.JAVA_VERSION
-
canRunInJavaVersion
public boolean canRunInJavaVersion(java.lang.String javaVersion)
Tells whether or not this add-on can be run in the givenjavaVersion
.If the given
javaVersion
isnull
and this add-on depends on a specific java version the method returnsfalse
.- Parameters:
javaVersion
- the java version that will be checked- Returns:
true
if the add-on can be loaded in the givenjavaVersion
,false
otherwise- Since:
- 2.4.0
-
calculateRunRequirements
public AddOn.AddOnRunRequirements calculateRunRequirements(java.util.Collection<AddOn> availableAddOns)
Calculates the requirements to run this add-on, in the current ZAP and Java versions and with the givenavailableAddOns
.If the add-on depends on other add-ons, those add-ons are also checked if are also runnable.
Note: All the given
availableAddOns
are expected to be loadable in the currently running ZAP version, that is, the methodAddOn.canLoadInCurrentVersion()
, returnstrue
.- Parameters:
availableAddOns
- the other add-ons available- Returns:
- a requirements to run the add-on, and if not runnable the reason why it's not.
- Since:
- 2.4.0
- See Also:
canLoadInCurrentVersion()
,canRunInCurrentJavaVersion()
,AddOn.AddOnRunRequirements
-
calculateInstallRequirements
public AddOn.AddOnRunRequirements calculateInstallRequirements(java.util.Collection<AddOn> availableAddOns)
Calculates the requirements to install/run this add-on, same ascalculateRunRequirements(Collection)
but does not require the libraries of the add-ons (this or dependencies) to exist in the file system.- Parameters:
availableAddOns
- the other add-ons available.- Returns:
- the requirements to install/run the add-on, and if not runnable the reason why it's not.
- Since:
- 2.9.0
- See Also:
calculateRunRequirements(Collection)
,AddOn.AddOnRunRequirements
-
calculateExtensionRunRequirements
public AddOn.AddOnRunRequirements calculateExtensionRunRequirements(Extension extension, java.util.Collection<AddOn> availableAddOns)
Calculates the requirements to run the givenextension
, in the current ZAP and Java versions and with the givenavailableAddOns
.If the extension depends on other add-ons, those add-ons are checked if are also runnable.
Note: All the given
availableAddOns
are expected to be loadable in the currently running ZAP version, that is, the methodAddOn.canLoadInCurrentVersion()
, returnstrue
.- Parameters:
extension
- the extension that will be checkedavailableAddOns
- the add-ons available- Returns:
- the requirements to run the extension, and if not runnable the reason why it's not.
- Since:
- 2.4.0
- See Also:
AddOn.AddOnRunRequirements.getExtensionRequirements()
-
calculateExtensionInstallRequirements
public AddOn.AddOnRunRequirements calculateExtensionInstallRequirements(Extension extension, java.util.Collection<AddOn> availableAddOns)
Calculates the requirements to install/run the givenextension
, same ascalculateExtensionRunRequirements(Extension, Collection)
but does not require the libraries of the add-ons (this or dependencies) to exist in the file system.- Parameters:
extension
- the extension that will be checked.availableAddOns
- the add-ons available.- Returns:
- the requirements to install/run the extension, and if not runnable the reason why it's not.
- Since:
- 2.9.0
- See Also:
AddOn.AddOnRunRequirements.getExtensionRequirements()
-
calculateExtensionRunRequirements
public AddOn.AddOnRunRequirements calculateExtensionRunRequirements(java.lang.String classname, java.util.Collection<AddOn> availableAddOns)
Calculates the requirements to run the extension with the givenclassname
, in the current ZAP and Java versions and with the givenavailableAddOns
.If the extension depends on other add-ons, those add-ons are checked if are also runnable.
Note: All the given
availableAddOns
are expected to be loadable in the currently running ZAP version, that is, the methodAddOn.canLoadInCurrentVersion()
, returnstrue
.- Parameters:
classname
- the classname of extension that will be checkedavailableAddOns
- the add-ons available- Returns:
- the requirements to run the extension, and if not runnable the reason why it's not.
- Since:
- 2.4.0
- See Also:
AddOn.AddOnRunRequirements.getExtensionRequirements()
-
calculateExtensionInstallRequirements
public AddOn.AddOnRunRequirements calculateExtensionInstallRequirements(java.lang.String classname, java.util.Collection<AddOn> availableAddOns)
Calculates the requirements to install/run the givenextension
, same ascalculateExtensionRunRequirements(String, Collection)
but does not require the libraries of the add-ons (this or dependencies) to exist in the file system.- Parameters:
classname
- the classname of extension that will be checked.availableAddOns
- the add-ons available.- Returns:
- the requirements to install/run the extension, and if not runnable the reason why it's not.
- Since:
- 2.9.0
- See Also:
AddOn.AddOnRunRequirements.getExtensionRequirements()
-
dependsOn
public boolean dependsOn(Extension extension, AddOn addOn)
Tells whether or not the givenextension
has a (direct) dependency on the givenaddOn
(including version).- Parameters:
extension
- the extension that will be checkedaddOn
- the add-on that will be checked in the dependencies on the extension- Returns:
true
if the extension depends on the given add-on,false
otherwise.- Since:
- 2.4.0
-
isExtensionLoaded
public boolean isExtensionLoaded(java.lang.String classname)
Tells whether or not the extension with the givenclassname
is loaded.- Parameters:
classname
- the classname of the extension- Returns:
true
if the extension is loaded,false
otherwise- Since:
- 2.4.0
-
getMinimumJavaVersion
public java.lang.String getMinimumJavaVersion()
Returns the minimum Java version required to run this add-on or an emptyString
if there's no minimum version.- Returns:
- the minimum Java version required to run this add-on or an empty
String
if no minimum version - Since:
- 2.4.0
-
canLoadInVersion
public boolean canLoadInVersion(java.lang.String zapVersion)
Tells whether or not this add-on can be loaded in the givenzapVersion
.- Parameters:
zapVersion
- the ZAP version that will be checked- Returns:
true
if the add-on can be loaded in the givenzapVersion
,false
otherwise
-
setNotBeforeVersion
public void setNotBeforeVersion(java.lang.String notBeforeVersion)
-
setNotFromVersion
public void setNotFromVersion(java.lang.String notFromVersion)
-
getNotBeforeVersion
public java.lang.String getNotBeforeVersion()
-
getNotFromVersion
public java.lang.String getNotFromVersion()
-
getInfo
public java.net.URL getInfo()
-
setInfo
public void setInfo(java.net.URL info)
-
getRepo
public java.net.URL getRepo()
Gets the URL to the browsable repo.- Returns:
- the URL to the repo, might be
null
. - Since:
- 2.9.0
-
getHash
public java.lang.String getHash()
-
getReleaseDate
public java.lang.String getReleaseDate()
Gets the date when the add-on was released.The date has the format
YYYY-MM-DD
.Note: The date is only available for add-ons created from the marketplace.
- Returns:
- the release date, or
null
if not available. - Since:
- 2.10.0
-
getBundleData
public AddOn.BundleData getBundleData()
Gets the data of the bundle declared in the manifest.- Returns:
- the bundle data, never
null
. - Since:
- 2.8.0
- See Also:
getResourceBundle()
-
getResourceBundle
public java.util.ResourceBundle getResourceBundle()
Gets the resource bundle of the add-on.- Returns:
- the resource bundle, or
null
if none. - Since:
- 2.8.0
-
setResourceBundle
public void setResourceBundle(java.util.ResourceBundle resourceBundle)
Sets the resource bundle of the add-on.Note: This method should be called only by bootstrap classes.
- Parameters:
resourceBundle
- the resource bundle of the add-on, might benull
.- Since:
- 2.8.0
- See Also:
getBundleData()
-
getHelpSetData
public AddOn.HelpSetData getHelpSetData()
Gets the data for the HelpSet, declared in the manifest.- Returns:
- the HelpSet data, never
null
. - Since:
- 2.8.0
-
setMandatory
public void setMandatory(boolean mandatory)
Sets if this add-on is mandatory.Note: This method should be called only by bootstrap classes.
- Parameters:
mandatory
-true
if the add-on is mandatory,false
otherwise.- Since:
- 2.12.0
- See Also:
isMandatory()
-
isMandatory
public boolean isMandatory()
Tells whether or not this add-on is mandatory.- Returns:
true
if the add-on is mandatory,false
otherwise.- Since:
- 2.12.0
-
getIdsAddOnDependencies
public java.util.List<java.lang.String> getIdsAddOnDependencies()
Returns the IDs of the add-ons dependencies, an empty collection if none.- Returns:
- the IDs of the dependencies.
- Since:
- 2.4.0
-
dependsOn
public boolean dependsOn(AddOn addOn)
Tells whether or not this add-on has a (direct) dependency on the givenaddOn
(including version).- Parameters:
addOn
- the add-on that will be checked- Returns:
true
if it depends on the given add-on,false
otherwise.- Since:
- 2.4.0
-
dependsOn
public boolean dependsOn(java.util.Collection<AddOn> addOns)
Tells whether or not this add-on has a (direct) dependency on any of the givenaddOns
(including version).- Parameters:
addOns
- the add-ons that will be checked- Returns:
true
if it depends on any of the given add-ons,false
otherwise.- Since:
- 2.4.0
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
Two add-ons are considered equal if both add-ons have the same ID and version.- Overrides:
equals
in classjava.lang.Object
-
-