From c1ac428fc67cfe13f9991026f7debac4e8075b01 Mon Sep 17 00:00:00 2001 From: Louis Date: Thu, 16 Jan 2020 12:43:12 +0100 Subject: [PATCH] Fix errors on Directories.java --- src/clientP2P/ClientP2P.java | 1 - src/serverP2P/ServerP2P.java | 1 - src/tools/Directories.java | 6 ++++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/clientP2P/ClientP2P.java b/src/clientP2P/ClientP2P.java index 396d7ec..8d7e678 100644 --- a/src/clientP2P/ClientP2P.java +++ b/src/clientP2P/ClientP2P.java @@ -1,5 +1,4 @@ package clientP2P; -import java.io.File; import clientP2P.ClientManagementUDP; import tools.Directories; diff --git a/src/serverP2P/ServerP2P.java b/src/serverP2P/ServerP2P.java index c147ad8..18c11f4 100644 --- a/src/serverP2P/ServerP2P.java +++ b/src/serverP2P/ServerP2P.java @@ -1,5 +1,4 @@ package serverP2P; -import java.io.File; import serverP2P.ServerManagementUDP; import tools.Directories; diff --git a/src/tools/Directories.java b/src/tools/Directories.java index 3782a2e..959bad9 100644 --- a/src/tools/Directories.java +++ b/src/tools/Directories.java @@ -1,4 +1,5 @@ package tools; +import java.io.File; /** Helper to get application directories. * @author Louis Royer @@ -24,13 +25,14 @@ public class Directories { /* Follow XDG Base Directory Specification * https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html */ + String d; String os = System.getProperty("os.name"); if (os.equals("Linux")) { d = System.getenv().get("XDG_DATA_HOME"); if (d == null || d.equals("")) { d = System.getProperty("user.home") + "/.local/share"; } - } else if (os.equals("Mac")||os.equals("Mac OS X") { + } else if (os.equals("Mac")||os.equals("Mac OS X")) { /* Apple MacOS X User Data Directory * https://developer.apple.com/library/archive/qa/qa1170/_index.html */ d = System.getProperty("user.home") + "/Library"; @@ -47,7 +49,7 @@ public class Directories { * @return path to the application home directory */ public String getDataHomeDirectory() { - return dataHomeDirectory(); + return dataHomeDirectory; }