added nexus configuration options

Former-commit-id: c5a7b5feac95909ee6b4359ebfd6badc261c68ae
This commit is contained in:
Jeremy Long
2014-01-24 18:50:54 -05:00
parent 3a698abf45
commit f537cc1b6a

View File

@@ -82,9 +82,7 @@ public class App {
if (cli.isGetVersion()) {
cli.printVersionInfo();
} else if (cli.isRunScan()) {
updateSettings(cli.isAutoUpdate(), cli.getConnectionTimeout(), cli.getProxyUrl(),
cli.getProxyPort(), cli.getProxyUsername(), cli.getProxyPassword(),
cli.getDataDirectory(), cli.getPropertiesFile(), cli.getSuppressionFile());
updateSettings(cli);
runScan(cli.getReportDirectory(), cli.getReportFormat(), cli.getApplicationName(), cli.getScanFiles());
} else {
cli.printHelp();
@@ -146,9 +144,19 @@ public class App {
* @param propertiesFile the properties file to utilize
* @param suppressionFile the path to the suppression file
*/
private void updateSettings(boolean autoUpdate, String connectionTimeout, String proxyUrl, String proxyPort,
String proxyUser, String proxyPass, String dataDirectory, File propertiesFile,
String suppressionFile) {
private void updateSettings(CliParser cli) {
boolean autoUpdate = cli.isAutoUpdate();
String connectionTimeout = cli.getConnectionTimeout();
String proxyUrl = cli.getProxyUrl();
String proxyPort = cli.getProxyPort();
String proxyUser = cli.getProxyUsername();
String proxyPass = cli.getProxyPassword();
String dataDirectory = cli.getDataDirectory();
File propertiesFile = cli.getPropertiesFile();
String suppressionFile = cli.getSuppressionFile();
boolean nexusDisabled = cli.isNexusDisabled();
String nexusUrl = cli.getNexusUrl();
if (propertiesFile != null) {
try {
@@ -194,5 +202,9 @@ public class App {
if (suppressionFile != null && !suppressionFile.isEmpty()) {
Settings.setString(Settings.KEYS.SUPPRESSION_FILE, suppressionFile);
}
Settings.setBoolean(Settings.KEYS.ANALYZER_NEXUS_ENABLED, !nexusDisabled);
if (nexusUrl != null && !nexusUrl.isEmpty()) {
Settings.setString(Settings.KEYS.ANALYZER_NEXUS_URL, nexusUrl);
}
}
}