diff options
Diffstat (limited to 'common/src')
| -rw-r--r-- | common/src/main/java/cz/crcs/ectester/common/util/FileUtil.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/common/src/main/java/cz/crcs/ectester/common/util/FileUtil.java b/common/src/main/java/cz/crcs/ectester/common/util/FileUtil.java index da682b6..734e957 100644 --- a/common/src/main/java/cz/crcs/ectester/common/util/FileUtil.java +++ b/common/src/main/java/cz/crcs/ectester/common/util/FileUtil.java @@ -44,16 +44,20 @@ public class FileUtil { if (System.getProperty("os.name").startsWith("Windows")) { appData = Paths.get(System.getenv("AppData")); + return appData; } else { if (System.getProperty("os.name").startsWith("Linux")) { String dataHome = System.getenv("XDG_DATA_HOME"); if (dataHome != null) { appData = Paths.get(dataHome); - } else { - appData = Paths.get(System.getProperty("user.home"), ".local", "share"); + return appData; } + } + String userHome = System.getProperty("user.home"); + if (userHome != null && !userHome.equals("?")) { + appData = Paths.get(userHome, ".local", "share"); } else { - appData = Paths.get(System.getProperty("user.home"), ".local", "share"); + appData = Paths.get(System.getenv("HOME"), ".local", "share"); } } return appData; |
