@ThreadSafe public class DownloadTask extends java.lang.Object implements java.util.concurrent.Callable<java.util.concurrent.Future<ProcessTask>>
Constructor and Description |
---|
DownloadTask(NvdCveInfo nvdCveInfo,
java.util.concurrent.ExecutorService processor,
CveDB cveDB,
Settings settings)
Simple constructor for the callable download task.
|
Modifier and Type | Method and Description |
---|---|
java.util.concurrent.Future<ProcessTask> |
call() |
void |
cleanup()
Attempts to delete the files that were downloaded.
|
void |
evictCorruptFileFromCache()
Attempts to delete the files that were downloaded.
|
java.io.File |
getFile()
Get the value of file.
|
NvdCveInfo |
getNvdCveInfo()
Get the value of nvdCveInfo.
|
boolean |
isModified()
Returns true if the process task is for the modified json file from the
NVD.
|
void |
setNvdCveInfo(NvdCveInfo nvdCveInfo)
Set the value of nvdCveInfo.
|
public DownloadTask(NvdCveInfo nvdCveInfo, java.util.concurrent.ExecutorService processor, CveDB cveDB, Settings settings) throws UpdateException
nvdCveInfo
- the NVD CVE infoprocessor
- the processor service to submit the downloaded files tocveDB
- the CVE DB to use to store the vulnerability datasettings
- a reference to the global settings object; this is
necessary so that when the thread is started the dependencies have a
correct reference to the global settings.UpdateException
- thrown if temporary files could not be createdpublic NvdCveInfo getNvdCveInfo()
public void setNvdCveInfo(NvdCveInfo nvdCveInfo)
nvdCveInfo
- new value of nvdCveInfopublic java.io.File getFile()
public java.util.concurrent.Future<ProcessTask> call() throws java.lang.Exception
call
in interface java.util.concurrent.Callable<java.util.concurrent.Future<ProcessTask>>
java.lang.Exception
public void cleanup()
public void evictCorruptFileFromCache()
public boolean isModified()
true
if the process task is for the modified data;
otherwise false
Copyright© 2012-21 Jeremy Long. All Rights Reserved.