diff options
author | Jonathan Bauer | 2018-04-26 18:19:48 +0200 |
---|---|---|
committer | Jonathan Bauer | 2018-04-26 18:19:48 +0200 |
commit | 1bfa51971154f6f851c33746aac3d9a37d00b5cf (patch) | |
tree | a18abe2381323e5e69c22cf82f5ae7fec0db4687 /dozentenmodul/src/main/java/org/openslx/dozmod/Config.java | |
parent | [client] Better warning for streamOptimized Images (diff) | |
download | tutor-module-1bfa51971154f6f851c33746aac3d9a37d00b5cf.tar.gz tutor-module-1bfa51971154f6f851c33746aac3d9a37d00b5cf.tar.xz tutor-module-1bfa51971154f6f851c33746aac3d9a37d00b5cf.zip |
fix broken links on some desktop
Introduce OSHelper class that should be used when trying to detect the type of
OS we are on. This is now used when deciding the path to save the config to
and when trying to execute the fallback command if opening the link via
java's desktop API fails.
Diffstat (limited to 'dozentenmodul/src/main/java/org/openslx/dozmod/Config.java')
-rwxr-xr-x | dozentenmodul/src/main/java/org/openslx/dozmod/Config.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/Config.java b/dozentenmodul/src/main/java/org/openslx/dozmod/Config.java index ba21544d..7a3db999 100755 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/Config.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/Config.java @@ -10,6 +10,7 @@ import java.util.Properties; import org.apache.log4j.Logger; import org.openslx.dozmod.gui.window.DisclaimerWindow; +import org.openslx.dozmod.util.OSHelper; import org.openslx.util.QuickTimer; import org.openslx.util.QuickTimer.Task; import org.openslx.util.Util; @@ -69,7 +70,7 @@ public class Config { // Determine OS String osName = System.getProperty("os.name").toLowerCase(); LOGGER.info("Machine's OS: " + osName); - if (osName.contains("windows")) { + if (OSHelper.isWindows()) { // Windows machine. Use the environment variable 'APPDATA' which // should point to a path similar to: // C:\Users\<user>\AppData\Roaming @@ -81,7 +82,7 @@ public class Config { LOGGER.warn("APPDATA is empty."); configPath = System.getProperty("user.home") + "\\AppData\\Roaming"; } - } else if (osName.contains("linux")) { + } else if (OSHelper.isLinux()) { configPath = System.getProperty("user.home") + "/.config"; } if (configPath == null || configPath.isEmpty()) { |