updated to support the new Settings implementation

Former-commit-id: 471a24d23377d74b88e0693d4e9632bfb28a8511
This commit is contained in:
Jeremy Long
2014-04-16 08:12:36 -04:00
parent 5529de3d95
commit dd925cd92b

View File

@@ -747,16 +747,9 @@ public class DependencyCheckScanAgent {
private Engine executeDependencyCheck() throws DatabaseException { private Engine executeDependencyCheck() throws DatabaseException {
populateSettings(); populateSettings();
Engine engine = null; Engine engine = null;
try { engine = new Engine();
engine = new Engine(); engine.setDependencies(this.dependencies);
engine.setDependencies(this.dependencies); engine.analyzeDependencies();
engine.analyzeDependencies();
} finally {
if (engine != null) {
engine.cleanup();
}
}
return engine; return engine;
} }
@@ -799,6 +792,7 @@ public class DependencyCheckScanAgent {
* properties required to change the proxy url, port, and connection timeout. * properties required to change the proxy url, port, and connection timeout.
*/ */
private void populateSettings() { private void populateSettings() {
Settings.initialize();
if (dataDirectory != null) { if (dataDirectory != null) {
Settings.setString(Settings.KEYS.DATA_DIRECTORY, dataDirectory); Settings.setString(Settings.KEYS.DATA_DIRECTORY, dataDirectory);
} else { } else {
@@ -891,6 +885,7 @@ public class DependencyCheckScanAgent {
"Unable to connect to the dependency-check database; analysis has stopped"); "Unable to connect to the dependency-check database; analysis has stopped");
Logger.getLogger(DependencyCheckScanAgent.class.getName()).log(Level.FINE, "", ex); Logger.getLogger(DependencyCheckScanAgent.class.getName()).log(Level.FINE, "", ex);
} finally { } finally {
Settings.cleanup();
if (engine != null) { if (engine != null) {
engine.cleanup(); engine.cleanup();
} }