mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-01-14 07:43:40 +01:00
moved several classes
Former-commit-id: 57cde1f76269c17d354e38db8ba25a5ab669e2c8
This commit is contained in:
@@ -35,7 +35,7 @@ import org.owasp.dependencycheck.analyzer.Analyzer;
|
||||
import org.owasp.dependencycheck.analyzer.AnalyzerService;
|
||||
import org.owasp.dependencycheck.data.update.CachedWebDataSource;
|
||||
import org.owasp.dependencycheck.exception.NoDataException;
|
||||
import org.owasp.dependencycheck.update.UpdateException;
|
||||
import org.owasp.dependencycheck.data.update.UpdateException;
|
||||
import org.owasp.dependencycheck.data.update.UpdateService;
|
||||
import org.owasp.dependencycheck.data.cpe.CpeMemoryIndex;
|
||||
import org.owasp.dependencycheck.data.cpe.IndexException;
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
package org.owasp.dependencycheck.data.nvdcve;
|
||||
|
||||
import java.util.Properties;
|
||||
import org.owasp.dependencycheck.update.UpdateException;
|
||||
import org.owasp.dependencycheck.data.update.UpdateException;
|
||||
import org.owasp.dependencycheck.data.update.NvdCveInfo;
|
||||
|
||||
/**
|
||||
|
||||
@@ -18,8 +18,6 @@
|
||||
*/
|
||||
package org.owasp.dependencycheck.data.update;
|
||||
|
||||
import org.owasp.dependencycheck.update.UpdateException;
|
||||
|
||||
/**
|
||||
* Defines a data source who's data is retrieved from the Internet. This data
|
||||
* can be downloaded and the local cache updated.
|
||||
|
||||
@@ -21,16 +21,15 @@ package org.owasp.dependencycheck.data.update;
|
||||
import java.net.MalformedURLException;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import org.owasp.dependencycheck.update.UpdateException;
|
||||
import org.owasp.dependencycheck.data.nvdcve.DatabaseException;
|
||||
import org.owasp.dependencycheck.utils.DownloadFailedException;
|
||||
|
||||
/**
|
||||
* Class responsible for updating the CPE and NVDCVE data stores.
|
||||
* Class responsible for updating the NVD CVE and CPE data stores.
|
||||
*
|
||||
* @author Jeremy Long (jeremy.long@owasp.org)
|
||||
*/
|
||||
public class DatabaseUpdater implements CachedWebDataSource {
|
||||
public class NvdCveUpdater implements CachedWebDataSource {
|
||||
|
||||
/**
|
||||
* <p>Downloads the latest NVD CVE XML file from the web and imports it into
|
||||
@@ -49,20 +48,20 @@ public class DatabaseUpdater implements CachedWebDataSource {
|
||||
task.recreateTables();
|
||||
} catch (DatabaseException ex) {
|
||||
final String msg = "Unable to update the database schema";
|
||||
Logger.getLogger(DatabaseUpdater.class.getName()).log(Level.SEVERE, msg);
|
||||
Logger.getLogger(DatabaseUpdater.class.getName()).log(Level.FINE, null, ex);
|
||||
Logger.getLogger(NvdCveUpdater.class.getName()).log(Level.SEVERE, msg);
|
||||
Logger.getLogger(NvdCveUpdater.class.getName()).log(Level.FINE, null, ex);
|
||||
}
|
||||
}
|
||||
task.update();
|
||||
}
|
||||
} catch (MalformedURLException ex) {
|
||||
Logger.getLogger(DatabaseUpdater.class.getName()).log(Level.WARNING,
|
||||
Logger.getLogger(NvdCveUpdater.class.getName()).log(Level.WARNING,
|
||||
"NVD CVE properties files contain an invalid URL, unable to update the data to use the most current data.");
|
||||
Logger.getLogger(DatabaseUpdater.class.getName()).log(Level.FINE, null, ex);
|
||||
Logger.getLogger(NvdCveUpdater.class.getName()).log(Level.FINE, null, ex);
|
||||
} catch (DownloadFailedException ex) {
|
||||
Logger.getLogger(DatabaseUpdater.class.getName()).log(Level.WARNING,
|
||||
Logger.getLogger(NvdCveUpdater.class.getName()).log(Level.WARNING,
|
||||
"Unable to download the NVD CVE data, unable to update the data to use the most current data.");
|
||||
Logger.getLogger(DatabaseUpdater.class.getName()).log(Level.FINE, null, ex);
|
||||
Logger.getLogger(NvdCveUpdater.class.getName()).log(Level.FINE, null, ex);
|
||||
}
|
||||
}
|
||||
//
|
||||
@@ -31,7 +31,6 @@ import java.util.logging.Logger;
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
import javax.xml.parsers.SAXParser;
|
||||
import javax.xml.parsers.SAXParserFactory;
|
||||
import org.owasp.dependencycheck.update.UpdateException;
|
||||
import org.owasp.dependencycheck.data.nvdcve.CveDB;
|
||||
import org.owasp.dependencycheck.data.nvdcve.DatabaseException;
|
||||
import org.owasp.dependencycheck.dependency.VulnerableSoftware;
|
||||
|
||||
@@ -32,7 +32,6 @@ import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.Future;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import org.owasp.dependencycheck.update.UpdateException;
|
||||
import org.owasp.dependencycheck.data.nvdcve.CveDB;
|
||||
import org.owasp.dependencycheck.utils.DownloadFailedException;
|
||||
import org.owasp.dependencycheck.utils.Settings;
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
*
|
||||
* Copyright (c) 2012 Jeremy Long. All Rights Reserved.
|
||||
*/
|
||||
package org.owasp.dependencycheck.update;
|
||||
package org.owasp.dependencycheck.data.update;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
org.owasp.dependencycheck.data.update.DatabaseUpdater
|
||||
@@ -0,0 +1 @@
|
||||
org.owasp.dependencycheck.data.update.NvdCveUpdater
|
||||
@@ -51,11 +51,11 @@ public class DatabaseUpdaterIntegrationTest {
|
||||
}
|
||||
|
||||
/**
|
||||
* Test of update method, of class DatabaseUpdater.
|
||||
* Test of update method, of class NvdCveUpdater.
|
||||
*/
|
||||
@Test
|
||||
public void testUpdate() throws Exception {
|
||||
DatabaseUpdater instance = new DatabaseUpdater();
|
||||
NvdCveUpdater instance = new NvdCveUpdater();
|
||||
instance.update();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,6 @@ import org.junit.Before;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
import static org.junit.Assert.*;
|
||||
import org.owasp.dependencycheck.update.UpdateException;
|
||||
import org.owasp.dependencycheck.utils.DownloadFailedException;
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user