From a04338d184b2b5cae1206d0264d51b54f92415da Mon Sep 17 00:00:00 2001 From: Jeremy Long Date: Tue, 9 Apr 2013 06:55:43 -0400 Subject: [PATCH] added counts for imported quantities Former-commit-id: 17673e8771d4314fc48bcf63f95a8992e6cbe17e --- .../data/nvdcve/xml/DatabaseUpdater.java | 30 +++++++++++-------- 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/src/main/java/org/owasp/dependencycheck/data/nvdcve/xml/DatabaseUpdater.java b/src/main/java/org/owasp/dependencycheck/data/nvdcve/xml/DatabaseUpdater.java index dd0ba4555..2fdf79c7d 100644 --- a/src/main/java/org/owasp/dependencycheck/data/nvdcve/xml/DatabaseUpdater.java +++ b/src/main/java/org/owasp/dependencycheck/data/nvdcve/xml/DatabaseUpdater.java @@ -83,7 +83,8 @@ public class DatabaseUpdater implements CachedWebDataSource { *

Downloads the latest NVD CVE XML file from the web and imports it into * the current CVE Database.

* - * @throws UpdateException is thrown if there is an error updating the database + * @throws UpdateException is thrown if there is an error updating the + * database */ public void update() throws UpdateException { try { @@ -164,7 +165,8 @@ public class DatabaseUpdater implements CachedWebDataSource { * * @param file the file containing the NVD CVE XML * @param oldVersion contains the file containing the NVD CVE XML 1.2 - * @throws ParserConfigurationException is thrown if there is a parserconfigurationexception + * @throws ParserConfigurationException is thrown if there is a + * parserconfigurationexception * @throws SAXException is thrown if there is a saxexception * @throws IOException is thrown if there is a ioexception * @throws SQLException is thrown if there is a sql exception @@ -195,6 +197,12 @@ public class DatabaseUpdater implements CachedWebDataSource { cve20Handler.setPrevVersionVulnMap(prevVersionVulnMap); cve20Handler.setCpeIndex(cpeIndex); saxParser.parse(file, cve20Handler); + +// Logger.getLogger(DatabaseUpdater.class.getName()).log(Level.WARNING, +// String.format("%d out of %d entries processed were application specific CVEs.", +// cve20Handler.getTotalNumberOfApplicationEntries(), +// cve20Handler.getTotalNumberOfEntries())); + cve20Handler = null; } finally { if (cpeIndex != null) { @@ -209,7 +217,6 @@ public class DatabaseUpdater implements CachedWebDataSource { } // - /** * Writes a properties file containing the last updated date to the * VULNERABLE_CPE directory. @@ -266,7 +273,8 @@ public class DatabaseUpdater implements CachedWebDataSource { * data is incorrect. * @throws DownloadFailedException is thrown if there is an error. * downloading the nvd cve download data file. - * @throws UpdateException Is thrown if there is an issue with the last updated properties file. + * @throws UpdateException Is thrown if there is an issue with the last + * updated properties file. */ public Map updateNeeded() throws MalformedURLException, DownloadFailedException, UpdateException { @@ -399,12 +407,12 @@ public class DatabaseUpdater implements CachedWebDataSource { * Retrieves the timestamps from the NVD CVE meta data file. * * @return the timestamp from the currently published nvdcve downloads page - * @throws MalformedURLException thrown if the URL for the NVD CCE Meta - * data is incorrect. - * @throws DownloadFailedException thrown if there is an error - * downloading the nvd cve meta data file - * @throws InvalidDataException thrown if there is an exception parsing - * the timestamps + * @throws MalformedURLException thrown if the URL for the NVD CCE Meta data + * is incorrect. + * @throws DownloadFailedException thrown if there is an error downloading + * the nvd cve meta data file + * @throws InvalidDataException thrown if there is an exception parsing the + * timestamps * @throws InvalidSettingException thrown if the settings are invalid */ protected Map retrieveCurrentTimestampsFromWeb() @@ -507,8 +515,6 @@ public class DatabaseUpdater implements CachedWebDataSource { public void setOldSchemaVersionUrl(String oldSchemaVersionUrl) { this.oldSchemaVersionUrl = oldSchemaVersionUrl; } - - /** * a timestamp - epoch time. */