From 0fbfbfb8f7484d81084f5ade10e3183b93def451 Mon Sep 17 00:00:00 2001 From: Jeremy Long Date: Fri, 3 Jan 2014 14:02:36 -0500 Subject: [PATCH] updated getDataFile() so that it no longer checks for a base data directory as the subdirectories have been removed Former-commit-id: ea5f520dbc71243d15e89e6b318c9bd7cbbe22ab --- .../owasp/dependencycheck/utils/Settings.java | 31 +++++-------------- 1 file changed, 7 insertions(+), 24 deletions(-) diff --git a/dependency-check-core/src/main/java/org/owasp/dependencycheck/utils/Settings.java b/dependency-check-core/src/main/java/org/owasp/dependencycheck/utils/Settings.java index 516cca36d..26f364d2e 100644 --- a/dependency-check-core/src/main/java/org/owasp/dependencycheck/utils/Settings.java +++ b/dependency-check-core/src/main/java/org/owasp/dependencycheck/utils/Settings.java @@ -67,16 +67,6 @@ public final class Settings { * The base path to use for the data directory. */ public static final String DATA_DIRECTORY = "data.directory"; - /** - * The location of the batch update URL. This is a zip file that - * contains the contents of the data directory. - */ - public static final String BATCH_UPDATE_URL = "batch.update.url"; - /** - * The properties key for the path where the CVE H2 database will be - * stored. - */ - public static final String CVE_DATA_DIRECTORY = "data.cve"; /** * The properties key for the URL to retrieve the "meta" data from about * the CVE entries. @@ -287,20 +277,13 @@ public final class Settings { */ public static File getDataFile(String key) { final String file = getString(key); - final String baseDir = getString(Settings.KEYS.DATA_DIRECTORY); - if (baseDir != null) { - if (baseDir.startsWith("[JAR]/")) { - final File jarPath = getJarPath(); - final File newBase = new File(jarPath, baseDir.substring(6)); - if (Settings.KEYS.DATA_DIRECTORY.equals(key)) { - return newBase; - } - return new File(newBase, file); - } - if (Settings.KEYS.DATA_DIRECTORY.equals(key)) { - return new File(baseDir); - } - return new File(baseDir, file); + if (file == null) { + return null; + } + if (file.startsWith("[JAR]/")) { + final File jarPath = getJarPath(); + final File newBase = new File(jarPath, file.substring(6)); + return new File(newBase, file); } return new File(file); }