mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-03-21 00:29:21 +01:00
made the ensureDBExists method perform a correct check rather then the previous hack
Former-commit-id: 5fae859fa7531761e78022eb2e8c4c41e6d5d150
This commit is contained in:
@@ -45,8 +45,10 @@ public abstract class BaseDBTestCase extends BaseTest {
|
|||||||
|
|
||||||
public static void ensureDBExists() throws Exception {
|
public static void ensureDBExists() throws Exception {
|
||||||
|
|
||||||
java.io.File dataPath = Settings.getDataFile(Settings.KEYS.DATA_DIRECTORY);
|
java.io.File dataPath = Settings.getDataDirectory();
|
||||||
if (!dataPath.exists() || (dataPath.isDirectory() && dataPath.listFiles().length < 3)) {
|
String fileName = String.format(Settings.getString(Settings.KEYS.DB_FILE_NAME), Settings.getString(Settings.KEYS.DB_VERSION));
|
||||||
|
java.io.File dataFile = new File(dataPath, fileName);
|
||||||
|
if (!dataPath.exists() || !dataFile.exists()) {
|
||||||
dataPath.mkdirs();
|
dataPath.mkdirs();
|
||||||
FileInputStream fis = null;
|
FileInputStream fis = null;
|
||||||
ZipInputStream zin = null;
|
ZipInputStream zin = null;
|
||||||
|
|||||||
Reference in New Issue
Block a user