|
|
|
@ -11,7 +11,8 @@ public class ServerP2P {
|
|
|
|
|
/* Follow XDG Base Directory Specification
|
|
|
|
|
* https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
|
|
|
|
|
*/
|
|
|
|
|
if (System.getProperty("os.name").equals("Linux")) {
|
|
|
|
|
String os = System.getProperty("os.name");
|
|
|
|
|
if (os.equals("Linux")) {
|
|
|
|
|
d = System.getenv().get("XDG_DATA_HOME");
|
|
|
|
|
if (d == null || d.equals("")) {
|
|
|
|
|
d = System.getenv().get("HOME");
|
|
|
|
@ -21,6 +22,10 @@ public class ServerP2P {
|
|
|
|
|
d += ".";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} 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/";
|
|
|
|
|
} else {
|
|
|
|
|
d = ".";
|
|
|
|
|
}
|
|
|
|
|