Class Purge
java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
org.owasp.dependencycheck.taskdefs.Purge
- All Implemented Interfaces:
Cloneable
- Direct Known Subclasses:
Update
public class Purge
extends org.apache.tools.ant.Task
An Ant task definition to execute dependency-check during an Ant build.
- Author:
- Jeremy Long
-
Field Summary
Fields inherited from class org.apache.tools.ant.Task
target, taskName, taskType, wrapperFields inherited from class org.apache.tools.ant.ProjectComponent
description, location, project -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidexecute()Sets theThread Context Class Loaderto the one for this class, and then callsexecuteWithContextClassloader().protected voidExecutes the dependency-check purge to delete the existing local copy of the NVD CVE data.booleanGet the value of failOnError.protected voidTakes the properties supplied and updates the dependency-check settings.voidsetDataDirectory(String dataDirectory) Set the value of dataDirectory.voidsetFailOnError(boolean failOnError) Set the value of failOnError.Methods inherited from class org.apache.tools.ant.Task
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskTypeMethods inherited from class org.apache.tools.ant.ProjectComponent
clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject
-
Constructor Details
-
Purge
public Purge()Construct a new DependencyCheckTask.
-
-
Method Details
-
getSettings
-
setDataDirectory
Set the value of dataDirectory.- Parameters:
dataDirectory- new value of dataDirectory
-
isFailOnError
public boolean isFailOnError()Get the value of failOnError.- Returns:
- the value of failOnError
-
setFailOnError
public void setFailOnError(boolean failOnError) Set the value of failOnError.- Parameters:
failOnError- new value of failOnError
-
execute
public final void execute() throws org.apache.tools.ant.BuildExceptionSets theThread Context Class Loaderto the one for this class, and then callsexecuteWithContextClassloader(). This is done because the JCS cache needs to have the Thread Context Class Loader set to something that can resolve it's classes. Other build tools do this by default but Ant does not.- Overrides:
executein classorg.apache.tools.ant.Task- Throws:
org.apache.tools.ant.BuildException- throws if there is a problem. SeeexecuteWithContextClassloader()for details
-
executeWithContextClassloader
protected void executeWithContextClassloader() throws org.apache.tools.ant.BuildExceptionExecutes the dependency-check purge to delete the existing local copy of the NVD CVE data.- Throws:
org.apache.tools.ant.BuildException- thrown if there is a problem deleting the file(s)
-
populateSettings
protected void populateSettings() throws org.apache.tools.ant.BuildExceptionTakes the properties supplied and updates the dependency-check settings. Additionally, this sets the system properties required to change the proxy server, port, and connection timeout.- Throws:
org.apache.tools.ant.BuildException- thrown if the properties file cannot be read.
-