mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-03-17 23:04:07 +01:00
added additional verbose logging
Former-commit-id: bf5bbd5211216d16e06fb1ab6b03d44258312b2c
This commit is contained in:
@@ -126,9 +126,10 @@ public final class ConnectionFactory {
|
|||||||
private static String getConnectionString() throws IOException {
|
private static String getConnectionString() throws IOException {
|
||||||
final String connStr = Settings.getString(Settings.KEYS.DB_CONNECTION_STRING, "jdbc:h2:file:%s;AUTO_SERVER=TRUE");
|
final String connStr = Settings.getString(Settings.KEYS.DB_CONNECTION_STRING, "jdbc:h2:file:%s;AUTO_SERVER=TRUE");
|
||||||
if (connStr.contains("%s")) {
|
if (connStr.contains("%s")) {
|
||||||
final String fileName = getDataDirectory().getCanonicalPath();
|
final String directory = getDataDirectory().getCanonicalPath();
|
||||||
final File file = new File(fileName, "cve." + DB_SCHEMA_VERSION);
|
final File data_file = new File(directory, "cve." + DB_SCHEMA_VERSION);
|
||||||
return String.format(connStr, file.getAbsolutePath());
|
Logger.getLogger(ConnectionFactory.class.getName()).log(Level.FINE, String.format("File path for H2 file: '%s'", data_file.toString()));
|
||||||
|
return String.format(connStr, data_file.getAbsolutePath());
|
||||||
}
|
}
|
||||||
return connStr;
|
return connStr;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -276,13 +276,18 @@ 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);
|
||||||
|
Logger.getLogger(Settings.class.getName()).log(Level.FINE, String.format("Settings.getDataFile() - file: '%s'", file));
|
||||||
if (file == null) {
|
if (file == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
if (file.startsWith("[JAR]/")) {
|
if (file.startsWith("[JAR]")) {
|
||||||
|
Logger.getLogger(Settings.class.getName()).log(Level.FINE, "Settings.getDataFile() - transforming filename");
|
||||||
final File jarPath = getJarPath();
|
final File jarPath = getJarPath();
|
||||||
|
Logger.getLogger(Settings.class.getName()).log(Level.FINE, String.format("Settings.getDataFile() - jar file: '%s'", jarPath.toString()));
|
||||||
final File newBase = new File(jarPath, file.substring(6));
|
final File newBase = new File(jarPath, file.substring(6));
|
||||||
return new File(newBase, file);
|
File retVal = new File(newBase, file);
|
||||||
|
Logger.getLogger(Settings.class.getName()).log(Level.FINE, String.format("Settings.getDataFile() - returning: '%s'", retVal.toString()));
|
||||||
|
return retVal;
|
||||||
}
|
}
|
||||||
return new File(file);
|
return new File(file);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user