From 069e75b4cdc0d62d79e5e3cd49bbd86cd78f3626 Mon Sep 17 00:00:00 2001 From: Nathan Cannon Date: Fri, 26 Feb 2016 16:12:27 +0000 Subject: [PATCH] Database location is interpreted as a file to ensure that relative locations work properly. --- .gitignore | 3 ++- src/main/java/musicplayer/ConfigManager.java | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index ed20917..a147e3f 100644 --- a/.gitignore +++ b/.gitignore @@ -69,4 +69,5 @@ buildNumber.properties # Created by .ignore support plugin (hsz.mobi) -settings.cfg \ No newline at end of file +settings.cfg +testdb.* \ No newline at end of file diff --git a/src/main/java/musicplayer/ConfigManager.java b/src/main/java/musicplayer/ConfigManager.java index b7e2a62..cec5730 100644 --- a/src/main/java/musicplayer/ConfigManager.java +++ b/src/main/java/musicplayer/ConfigManager.java @@ -45,7 +45,7 @@ public final class ConfigManager { try (FileInputStream inputStream = new FileInputStream(propertiesFile)) { librarySettings.load(inputStream); if (librarySettings.containsKey(databaseKey)) { - return "jdbc:hsqldb:file:" + librarySettings.getProperty(databaseKey) + ";shutdown=true"; + return "jdbc:hsqldb:file:" + new File(librarySettings.getProperty(databaseKey)).getAbsolutePath() + ";shutdown=true"; } } catch (IOException ignored) { }