-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathPlatform.java
More file actions
31 lines (23 loc) · 788 Bytes
/
Copy pathPlatform.java
File metadata and controls
31 lines (23 loc) · 788 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package org.freedesktop;
import java.util.Map;
import org.freedesktop.platforms.Darwin;
import org.freedesktop.platforms.Default;
import org.freedesktop.platforms.Windows;
public abstract class Platform {
protected static Map<String,String> environment = System.getenv();
public abstract String getCacheHome();
public abstract String getConfigDirs();
public abstract String getConfigHome();
public abstract String getDataDirs();
public abstract String getDataHome();
public abstract String getRuntimeDir();
public static Platform getCurrent() {
String osName = System.getProperty("os.name");
if (osName.startsWith("Mac OS X")) {
return new Darwin();
} else if (osName.startsWith("Windows")) {
return new Windows();
}
return new Default();
}
}