updated to support the new Settings implementation

Former-commit-id: 2e275cd7333b0e44b46745d5f51f89f3f1687b8f
This commit is contained in:
Jeremy Long
2014-04-16 08:12:36 -04:00
parent 38f69fd7cc
commit b24c63cb49

View File

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