Skip to content
Snippets Groups Projects
Commit ec4f4b4b authored by Robert Goldmann's avatar Robert Goldmann
Browse files

Fixed #78

parent c3df3608
No related branches found
No related tags found
1 merge request!104merge v_1_2_0 into master
......@@ -48,7 +48,7 @@ public class Main
settings = Utils.loadSettings();
new SparkServer(settings);
}
catch(IOException e)
catch(IOException | URISyntaxException e)
{
Logger.error(e);
}
......
package de.deadlocker8.budgetmasterserver.main;
import java.io.IOException;
import java.net.URISyntaxException;
import java.nio.file.Files;
import java.nio.file.Paths;
......@@ -8,13 +9,14 @@ import com.google.gson.Gson;
public class Utils
{
public static Settings loadSettings() throws IOException
public static Settings loadSettings() throws IOException, URISyntaxException
{
String settingsJSON;
Settings settings;
Gson gson = new Gson();
settingsJSON = new String(Files.readAllBytes(Paths.get("settings.json")));
settingsJSON = new String(Files.readAllBytes(Paths.get(Settings.class.getProtectionDomain().getCodeSource().getLocation().toURI()).resolve("settings.json")));
settings = gson.fromJson(settingsJSON, Settings.class);
return settings;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment