diff --git a/PlayWall/src/de/tobias/playpad/PlayPadMain.java b/PlayWall/src/de/tobias/playpad/PlayPadMain.java index 429036da604cb52fa0ee4bd78e8b444d56e28368..a399f8561daefd030f8207f3db9cedea6ae18af1 100644 --- a/PlayWall/src/de/tobias/playpad/PlayPadMain.java +++ b/PlayWall/src/de/tobias/playpad/PlayPadMain.java @@ -190,7 +190,6 @@ public class PlayPadMain extends Application implements LocalizationDelegate, Pr } ViewController.create(LaunchDialog.class, stage); - } @Override @@ -256,7 +255,7 @@ public class PlayPadMain extends Application implements LocalizationDelegate, Pr private void setupPlugins(Path pluginPath) throws IOException, MalformedURLException { // Delete old plugins impl.deletePlugins(); - + // Load Plugins impl.loadPlugin(pluginPath.toUri()); } diff --git a/PlayWallCore/src/de/tobias/playpad/project/ProjectReference.java b/PlayWallCore/src/de/tobias/playpad/project/ProjectReference.java index 8dd9ff1d3887837e9c386ec7689cca326dffc27b..44724c67c6a3815083e9c4eac9bb2b697f63acf9 100644 --- a/PlayWallCore/src/de/tobias/playpad/project/ProjectReference.java +++ b/PlayWallCore/src/de/tobias/playpad/project/ProjectReference.java @@ -147,9 +147,10 @@ public class ProjectReference implements Displayable { public static void loadProjects() throws DocumentException, IOException { Path path = ApplicationUtils.getApplication().getPath(PathType.CONFIGURATION, FILE_NAME); - XMLHandler<ProjectReference> loader = new XMLHandler<>(path); - projects = loader.loadElements(PROJECT_ELEMENT, new ProjectReferenceSerializer()); - + if (Files.exists(path)) { + XMLHandler<ProjectReference> loader = new XMLHandler<>(path); + projects = loader.loadElements(PROJECT_ELEMENT, new ProjectReferenceSerializer()); + } loadedProjectOverview = true; } @@ -161,6 +162,10 @@ public class ProjectReference implements Displayable { handler.saveElements(PROJECT_ELEMENT, projects, new ProjectReferenceSerializer()); Path path = ApplicationUtils.getApplication().getPath(PathType.CONFIGURATION, FILE_NAME); + if (Files.notExists(path)) { + Files.createDirectories(path.getParent()); + Files.createFile(path); + } XMLHandler.save(path, document); } diff --git a/PlayWallCore/src/de/tobias/playpad/settings/ProfileReference.java b/PlayWallCore/src/de/tobias/playpad/settings/ProfileReference.java index 9eaf5a154233d099d757f234a5f65142504568e2..ba3a13d08fed86e8553a404235e11a69e8c57d3b 100644 --- a/PlayWallCore/src/de/tobias/playpad/settings/ProfileReference.java +++ b/PlayWallCore/src/de/tobias/playpad/settings/ProfileReference.java @@ -272,6 +272,10 @@ public class ProfileReference implements Displayable { handler.saveElements(PROFILE_ELEMENT, profiles, new ProfileReferenceSerializer()); Path path = ApplicationUtils.getApplication().getPath(PathType.CONFIGURATION, FILE_NAME); + if (Files.notExists(path)) { + Files.createDirectories(path.getParent()); + Files.createFile(path); + } XMLHandler.save(path, document); }