moved several classes

Former-commit-id: 57cde1f76269c17d354e38db8ba25a5ab669e2c8
This commit is contained in:
Jeremy Long
2014-01-04 09:01:04 -05:00
parent ba8bd4f95c
commit cee4b089c6
11 changed files with 14 additions and 20 deletions

View File

@@ -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;

View File

@@ -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;
/**

View File

@@ -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.

View File

@@ -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);
}
}
//

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -1 +0,0 @@
org.owasp.dependencycheck.data.update.DatabaseUpdater

View File

@@ -0,0 +1 @@
org.owasp.dependencycheck.data.update.NvdCveUpdater

View File

@@ -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();
}
}

View File

@@ -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;
/**