mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-03-25 18:41:44 +01:00
updated getDataFile() so that it no longer checks for a base data directory as the subdirectories have been removed
Former-commit-id: 77ae2cb573211de12015606ade9482ca7f0c3d2d
This commit is contained in:
@@ -67,16 +67,6 @@ public final class Settings {
|
|||||||
* The base path to use for the data directory.
|
* The base path to use for the data directory.
|
||||||
*/
|
*/
|
||||||
public static final String DATA_DIRECTORY = "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 properties key for the URL to retrieve the "meta" data from about
|
||||||
* the CVE entries.
|
* the CVE entries.
|
||||||
@@ -287,21 +277,14 @@ public final class Settings {
|
|||||||
*/
|
*/
|
||||||
public static File getDataFile(String key) {
|
public static File getDataFile(String key) {
|
||||||
final String file = getString(key);
|
final String file = getString(key);
|
||||||
final String baseDir = getString(Settings.KEYS.DATA_DIRECTORY);
|
if (file == null) {
|
||||||
if (baseDir != null) {
|
return null;
|
||||||
if (baseDir.startsWith("[JAR]/")) {
|
}
|
||||||
|
if (file.startsWith("[JAR]/")) {
|
||||||
final File jarPath = getJarPath();
|
final File jarPath = getJarPath();
|
||||||
final File newBase = new File(jarPath, baseDir.substring(6));
|
final File newBase = new File(jarPath, file.substring(6));
|
||||||
if (Settings.KEYS.DATA_DIRECTORY.equals(key)) {
|
|
||||||
return newBase;
|
|
||||||
}
|
|
||||||
return new File(newBase, file);
|
return new File(newBase, file);
|
||||||
}
|
}
|
||||||
if (Settings.KEYS.DATA_DIRECTORY.equals(key)) {
|
|
||||||
return new File(baseDir);
|
|
||||||
}
|
|
||||||
return new File(baseDir, file);
|
|
||||||
}
|
|
||||||
return new File(file);
|
return new File(file);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user