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, wrapper

    Fields inherited from class org.apache.tools.ant.ProjectComponent

    description, location, project
  • Constructor Summary

    Constructors
    Constructor
    Description
    Construct a new DependencyCheckTask.
  • Method Summary

    Modifier and Type
    Method
    Description
    final void
    Sets the Thread Context Class Loader to the one for this class, and then calls executeWithContextClassloader().
    protected void
    Executes the dependency-check purge to delete the existing local copy of the NVD CVE data.
     
    boolean
    Get the value of failOnError.
    protected void
    Takes the properties supplied and updates the dependency-check settings.
    void
    setDataDirectory(String dataDirectory)
    Set the value of dataDirectory.
    void
    setFailOnError(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, setTaskType

    Methods inherited from class org.apache.tools.ant.ProjectComponent

    clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject

    Methods inherited from class Object

    equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Purge

      public Purge()
      Construct a new DependencyCheckTask.
  • Method Details

    • getSettings

      public Settings getSettings()
    • setDataDirectory

      public void setDataDirectory(String dataDirectory)
      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.BuildException
      Sets the Thread Context Class Loader to the one for this class, and then calls executeWithContextClassloader(). 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:
      execute in class org.apache.tools.ant.Task
      Throws:
      org.apache.tools.ant.BuildException - throws if there is a problem. See executeWithContextClassloader() for details
    • executeWithContextClassloader

      protected void executeWithContextClassloader() throws org.apache.tools.ant.BuildException
      Executes 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.BuildException
      Takes 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.