Commit 991b0b6c by Jason Song Committed by GitHub

Merge pull request #391 from nobodyiam/client-windows

add spport for windows local cache dir
parents ee7148f1 525a2b86
...@@ -185,8 +185,8 @@ public class ConfigUtil { ...@@ -185,8 +185,8 @@ public class ConfigUtil {
} }
public String getDefaultLocalCacheDir() { public String getDefaultLocalCacheDir() {
//TODO call Framework Foundation to get the default local cache dir String cacheRoot = isOSWindows() ? "C:\\opt\\data\\%s" : "/opt/data/%s";
return String.format("/opt/data/%s", getAppId()); return String.format(cacheRoot, getAppId());
} }
public boolean isInLocalMode() { public boolean isInLocalMode() {
...@@ -198,4 +198,12 @@ public class ConfigUtil { ...@@ -198,4 +198,12 @@ public class ConfigUtil {
} }
return false; return false;
} }
public boolean isOSWindows() {
String osName = System.getProperty("os.name");
if (Strings.isNullOrEmpty(osName)) {
return false;
}
return osName.startsWith("Windows");
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment