use of org.parosproxy.paros.extension.Extension in project zaproxy by zaproxy.
the class AddOnInstaller method install.
/**
* Installs all the (dynamically installable) components ({@code Extension}s, {@code Plugin}s, {@code PassiveScanner}s and
* files) of the given {@code addOn}.
* <p>
* It's also responsible to notify the installed extensions when the installation has finished by calling the method
* {@code Extension#postInstall()}.
* <p>
* The components are installed in the following order:
* <ol>
* <li>Files;</li>
* <li>Extensions;</li>
* <li>Active scanners;</li>
* <li>Passive scanners.</li>
* </ol>
* The files are installed first as they might be required by extensions and scanners.
*
* @param addOnClassLoader the class loader of the given {@code addOn}
* @param addOn the add-on that will be installed
* @see Extension
* @see PassiveScanner
* @see org.parosproxy.paros.core.scanner.Plugin
* @see Extension#postInstall()
*/
public static void install(AddOnClassLoader addOnClassLoader, AddOn addOn) {
installAddOnFiles(addOnClassLoader, addOn, true);
List<Extension> listExts = installAddOnExtensions(addOn);
installAddOnActiveScanRules(addOn, addOnClassLoader);
installAddOnPassiveScanRules(addOn, addOnClassLoader);
// postInstall actions
for (Extension ext : listExts) {
try {
ext.postInstall();
} catch (Exception e) {
logger.error("Post install method failed for add-on " + addOn.getId() + " extension " + ext.getName());
}
}
}
use of org.parosproxy.paros.extension.Extension in project zaproxy by zaproxy.
the class ReportLastScan method getExtensionsXML.
public StringBuilder getExtensionsXML(SiteNode site) {
StringBuilder extensionXml = new StringBuilder();
ExtensionLoader loader = Control.getSingleton().getExtensionLoader();
int extensionCount = loader.getExtensionCount();
for (int i = 0; i < extensionCount; i++) {
Extension extension = loader.getExtension(i);
if (extension instanceof XmlReporterExtension) {
extensionXml.append(((XmlReporterExtension) extension).getXml(site));
}
}
return extensionXml;
}
Aggregations