Class Update
- java.lang.Object
-
- org.apache.tools.ant.ProjectComponent
-
- org.apache.tools.ant.Task
-
- org.owasp.dependencycheck.taskdefs.Purge
-
- org.owasp.dependencycheck.taskdefs.Update
-
- All Implemented Interfaces:
java.lang.Cloneable
- Direct Known Subclasses:
Check
public class Update extends Purge
An Ant task definition to execute dependency-check update. This will download the latest data from the National Vulnerability Database (NVD) and store a copy in the local database.- Author:
- Jeremy Long
-
-
Constructor Summary
Constructors Constructor Description Update()
Construct a new UpdateTask.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
executeWithContextClassloader()
Executes the update by initializing the settings, downloads the NVD XML data, and then processes the data storing it in the local database.java.lang.String
getConnectionString()
Get the value of connectionString.java.lang.String
getConnectionTimeout()
Get the value of connectionTimeout.java.lang.String
getDatabaseDriverName()
Get the value of databaseDriverName.java.lang.String
getDatabaseDriverPath()
Get the value of databaseDriverPath.java.lang.String
getDatabasePassword()
Get the value of databasePassword.java.lang.String
getDatabaseUser()
Get the value of databaseUser.java.lang.Integer
getHostedSuppressionsValidForHours()
Get the value of hostedSuppressionsValidForHours.java.lang.String
getNonProxyHosts()
Get the value of nonProxyHosts.int
getNvdApiDelay()
Get the value of nvdApiDelay.java.lang.String
getNvdApiEndpoint()
Get the value of nvdApiEndpoint.java.lang.String
getNvdApiKey()
Get the value of nvdApiKey.int
getNvdApiResultsPerPage()
Get the value of nvdApiResultsPerPage.java.lang.String
getNvdDatafeedUrl()
Get the value of nvdDatafeedUrl.int
getNvdMaxRetryCounts()
Get the value of nvdMaxRetryCount.java.lang.String
getNvdPassword()
Get the value of nvdPassword.java.lang.String
getNvdUser()
Get the value of nvdUser.int
getNvdValidForHours()
Get the value of nvdValidForHours.java.lang.String
getProxyPassword()
Get the value of proxyPassword.java.lang.String
getProxyPort()
Get the value of proxyPort.java.lang.String
getProxyServer()
Get the value of proxyServer.java.lang.String
getProxyUsername()
Get the value of proxyUsername.java.lang.String
getReadTimeout()
Get the value of readTimeout.java.lang.Boolean
isHostedSuppressionsEnabled()
Get the value of hostedSuppressionsEnabled.java.lang.Boolean
isHostedSuppressionsForceUpdate()
Get the value of hostedSuppressionsForceUpdate.protected void
populateSettings()
Takes the properties supplied and updates the dependency-check settings.void
setApiResultsPerPage(int nvdApiResultsPerPage)
Set the value of nvdApiResultsPerPage.void
setConnectionString(java.lang.String connectionString)
Set the value of connectionString.void
setConnectionTimeout(java.lang.String connectionTimeout)
Set the value of connectionTimeout.void
setDatabaseDriverName(java.lang.String databaseDriverName)
Set the value of databaseDriverName.void
setDatabaseDriverPath(java.lang.String databaseDriverPath)
Set the value of databaseDriverPath.void
setDatabasePassword(java.lang.String databasePassword)
Set the value of databasePassword.void
setDatabaseUser(java.lang.String databaseUser)
Set the value of databaseUser.void
setHostedSuppressionsEnabled(java.lang.Boolean hostedSuppressionsEnabled)
Set the value of hostedSuppressionsEnabled.void
setHostedSuppressionsForceUpdate(java.lang.Boolean hostedSuppressionsForceUpdate)
Set the value of hostedSuppressionsForceUpdate.void
setHostedSuppressionsValidForHours(java.lang.Integer hostedSuppressionsValidForHours)
Set the value of hostedSuppressionsValidForHours.void
setNonProxyHosts(java.lang.String nonProxyHosts)
Set the value of nonProxyHosts.void
setNvdApiDelay(int nvdApiDelay)
Set the value of nvdApiDelay.void
setNvdApiEndpoint(java.lang.String nvdApiEndpoint)
Set the value of nvdApiEndpoint.void
setNvdApiKey(java.lang.String nvdApiKey)
Set the value of nvdApiKey.void
setNvdDatafeedUrl(java.lang.String nvdDatafeedUrl)
Set the value of nvdDatafeedUrl.void
setNvdMaxRetryCount(int nvdMaxRetryCount)
Set the value of nvdMaxRetryCount.void
setNvdPassword(java.lang.String nvdPassword)
Set the value of nvdPassword.void
setNvdUser(java.lang.String nvdUser)
Set the value of nvdUser.void
setNvdValidForHours(int nvdValidForHours)
Set the value of nvdValidForHours.void
setProxyPassword(java.lang.String proxyPassword)
Set the value of proxyPassword.void
setProxyPort(java.lang.String proxyPort)
Set the value of proxyPort.void
setProxyServer(java.lang.String server)
Set the value of proxyServer.void
setProxyUsername(java.lang.String proxyUsername)
Set the value of proxyUsername.void
setReadTimeout(java.lang.String readTimeout)
Set the value of readTimeout.-
Methods inherited from class org.owasp.dependencycheck.taskdefs.Purge
execute, getDataDirectory, getHostedSuppressionsUrl, getSettings, isFailOnError, setDataDirectory, setFailOnError, setHostedSuppressionsUrl
-
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
-
-
-
-
Method Detail
-
getNvdApiEndpoint
public java.lang.String getNvdApiEndpoint()
Get the value of nvdApiEndpoint.- Returns:
- the value of nvdApiEndpoint
-
setNvdApiEndpoint
public void setNvdApiEndpoint(java.lang.String nvdApiEndpoint)
Set the value of nvdApiEndpoint.- Parameters:
nvdApiEndpoint
- new value of nvdApiEndpoint
-
getNvdApiKey
public java.lang.String getNvdApiKey()
Get the value of nvdApiKey.- Returns:
- the value of nvdApiKey
-
setNvdApiKey
public void setNvdApiKey(java.lang.String nvdApiKey)
Set the value of nvdApiKey.- Parameters:
nvdApiKey
- new value of nvdApiKey
-
getNvdMaxRetryCounts
public int getNvdMaxRetryCounts()
Get the value of nvdMaxRetryCount.- Returns:
- the value of nvdMaxRetryCount
-
setNvdMaxRetryCount
public void setNvdMaxRetryCount(int nvdMaxRetryCount)
Set the value of nvdMaxRetryCount.- Parameters:
nvdMaxRetryCount
- new value of nvdMaxRetryCount
-
getNvdValidForHours
public int getNvdValidForHours()
Get the value of nvdValidForHours.- Returns:
- the value of nvdValidForHours
-
setNvdValidForHours
public void setNvdValidForHours(int nvdValidForHours)
Set the value of nvdValidForHours.- Parameters:
nvdValidForHours
- new value of nvdValidForHours
-
getNvdDatafeedUrl
public java.lang.String getNvdDatafeedUrl()
Get the value of nvdDatafeedUrl.- Returns:
- the value of nvdDatafeedUrl
-
setNvdDatafeedUrl
public void setNvdDatafeedUrl(java.lang.String nvdDatafeedUrl)
Set the value of nvdDatafeedUrl.- Parameters:
nvdDatafeedUrl
- new value of nvdDatafeedUrl
-
getNvdUser
public java.lang.String getNvdUser()
Get the value of nvdUser.- Returns:
- the value of nvdUser
-
setNvdUser
public void setNvdUser(java.lang.String nvdUser)
Set the value of nvdUser.- Parameters:
nvdUser
- new value of nvdUser
-
getNvdPassword
public java.lang.String getNvdPassword()
Get the value of nvdPassword.- Returns:
- the value of nvdPassword
-
setNvdPassword
public void setNvdPassword(java.lang.String nvdPassword)
Set the value of nvdPassword.- Parameters:
nvdPassword
- new value of nvdPassword
-
getNvdApiDelay
public int getNvdApiDelay()
Get the value of nvdApiDelay.- Returns:
- the value of nvdApiDelay
-
setNvdApiDelay
public void setNvdApiDelay(int nvdApiDelay)
Set the value of nvdApiDelay.- Parameters:
nvdApiDelay
- new value of nvdApiDelay
-
getNvdApiResultsPerPage
public int getNvdApiResultsPerPage()
Get the value of nvdApiResultsPerPage.- Returns:
- the value of nvdApiResultsPerPage
-
setApiResultsPerPage
public void setApiResultsPerPage(int nvdApiResultsPerPage)
Set the value of nvdApiResultsPerPage.- Parameters:
nvdApiResultsPerPage
- new value of nvdApiResultsPerPage
-
getProxyServer
public java.lang.String getProxyServer()
Get the value of proxyServer.- Returns:
- the value of proxyServer
-
setProxyServer
public void setProxyServer(java.lang.String server)
Set the value of proxyServer.- Parameters:
server
- new value of proxyServer
-
getProxyPort
public java.lang.String getProxyPort()
Get the value of proxyPort.- Returns:
- the value of proxyPort
-
setProxyPort
public void setProxyPort(java.lang.String proxyPort)
Set the value of proxyPort.- Parameters:
proxyPort
- new value of proxyPort
-
getProxyUsername
public java.lang.String getProxyUsername()
Get the value of proxyUsername.- Returns:
- the value of proxyUsername
-
setProxyUsername
public void setProxyUsername(java.lang.String proxyUsername)
Set the value of proxyUsername.- Parameters:
proxyUsername
- new value of proxyUsername
-
getProxyPassword
public java.lang.String getProxyPassword()
Get the value of proxyPassword.- Returns:
- the value of proxyPassword
-
setProxyPassword
public void setProxyPassword(java.lang.String proxyPassword)
Set the value of proxyPassword.- Parameters:
proxyPassword
- new value of proxyPassword
-
getNonProxyHosts
public java.lang.String getNonProxyHosts()
Get the value of nonProxyHosts.- Returns:
- the value of nonProxyHosts
-
setNonProxyHosts
public void setNonProxyHosts(java.lang.String nonProxyHosts)
Set the value of nonProxyHosts.- Parameters:
nonProxyHosts
- new value of nonProxyHosts
-
getConnectionTimeout
public java.lang.String getConnectionTimeout()
Get the value of connectionTimeout.- Returns:
- the value of connectionTimeout
-
setConnectionTimeout
public void setConnectionTimeout(java.lang.String connectionTimeout)
Set the value of connectionTimeout.- Parameters:
connectionTimeout
- new value of connectionTimeout
-
getReadTimeout
public java.lang.String getReadTimeout()
Get the value of readTimeout.- Returns:
- the value of readTimeout
-
setReadTimeout
public void setReadTimeout(java.lang.String readTimeout)
Set the value of readTimeout.- Parameters:
readTimeout
- new value of readTimeout
-
getDatabaseDriverName
public java.lang.String getDatabaseDriverName()
Get the value of databaseDriverName.- Returns:
- the value of databaseDriverName
-
setDatabaseDriverName
public void setDatabaseDriverName(java.lang.String databaseDriverName)
Set the value of databaseDriverName.- Parameters:
databaseDriverName
- new value of databaseDriverName
-
getDatabaseDriverPath
public java.lang.String getDatabaseDriverPath()
Get the value of databaseDriverPath.- Returns:
- the value of databaseDriverPath
-
setDatabaseDriverPath
public void setDatabaseDriverPath(java.lang.String databaseDriverPath)
Set the value of databaseDriverPath.- Parameters:
databaseDriverPath
- new value of databaseDriverPath
-
getConnectionString
public java.lang.String getConnectionString()
Get the value of connectionString.- Returns:
- the value of connectionString
-
setConnectionString
public void setConnectionString(java.lang.String connectionString)
Set the value of connectionString.- Parameters:
connectionString
- new value of connectionString
-
getDatabaseUser
public java.lang.String getDatabaseUser()
Get the value of databaseUser.- Returns:
- the value of databaseUser
-
setDatabaseUser
public void setDatabaseUser(java.lang.String databaseUser)
Set the value of databaseUser.- Parameters:
databaseUser
- new value of databaseUser
-
getDatabasePassword
public java.lang.String getDatabasePassword()
Get the value of databasePassword.- Returns:
- the value of databasePassword
-
setDatabasePassword
public void setDatabasePassword(java.lang.String databasePassword)
Set the value of databasePassword.- Parameters:
databasePassword
- new value of databasePassword
-
getHostedSuppressionsValidForHours
public java.lang.Integer getHostedSuppressionsValidForHours()
Get the value of hostedSuppressionsValidForHours.- Returns:
- the value of hostedSuppressionsValidForHours
-
setHostedSuppressionsValidForHours
public void setHostedSuppressionsValidForHours(java.lang.Integer hostedSuppressionsValidForHours)
Set the value of hostedSuppressionsValidForHours.- Parameters:
hostedSuppressionsValidForHours
- new value of hostedSuppressionsValidForHours
-
isHostedSuppressionsForceUpdate
public java.lang.Boolean isHostedSuppressionsForceUpdate()
Get the value of hostedSuppressionsForceUpdate.- Returns:
- the value of hostedSuppressionsForceUpdate
-
setHostedSuppressionsForceUpdate
public void setHostedSuppressionsForceUpdate(java.lang.Boolean hostedSuppressionsForceUpdate)
Set the value of hostedSuppressionsForceUpdate.- Parameters:
hostedSuppressionsForceUpdate
- new value of hostedSuppressionsForceUpdate
-
isHostedSuppressionsEnabled
public java.lang.Boolean isHostedSuppressionsEnabled()
Get the value of hostedSuppressionsEnabled.- Returns:
- the value of hostedSuppressionsEnabled
-
setHostedSuppressionsEnabled
public void setHostedSuppressionsEnabled(java.lang.Boolean hostedSuppressionsEnabled)
Set the value of hostedSuppressionsEnabled.- Parameters:
hostedSuppressionsEnabled
- new value of hostedSuppressionsEnabled
-
executeWithContextClassloader
protected void executeWithContextClassloader() throws org.apache.tools.ant.BuildException
Executes the update by initializing the settings, downloads the NVD XML data, and then processes the data storing it in the local database.- Overrides:
executeWithContextClassloader
in classPurge
- Throws:
org.apache.tools.ant.BuildException
- thrown if a connection to the local database cannot be made.
-
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.- Overrides:
populateSettings
in classPurge
- Throws:
org.apache.tools.ant.BuildException
- thrown when an invalid setting is configured.
-
-