Add default data dir property

This commit is contained in:
crschnick 2024-08-02 17:33:05 +00:00
parent ce5c06c124
commit 7390d3b25c

View file

@ -37,6 +37,7 @@ public class AppProperties {
boolean useVirtualThreads;
boolean debugThreads;
Path dataDir;
Path defaultDataDir;
boolean showcase;
AppVersion canonicalVersion;
boolean locatePtb;
@ -87,6 +88,7 @@ public class AppProperties {
debugThreads = Optional.ofNullable(System.getProperty("io.xpipe.app.debugThreads"))
.map(Boolean::parseBoolean)
.orElse(false);
defaultDataDir = Path.of(System.getProperty("user.home"), isStaging() ? ".xpipe-ptb" : ".xpipe");
dataDir = Optional.ofNullable(System.getProperty("io.xpipe.app.dataDir"))
.map(s -> {
var p = Path.of(s);
@ -95,7 +97,7 @@ public class AppProperties {
}
return p;
})
.orElse(Path.of(System.getProperty("user.home"), isStaging() ? ".xpipe-ptb" : ".xpipe"));
.orElse(defaultDataDir);
showcase = Optional.ofNullable(System.getProperty("io.xpipe.app.showcase"))
.map(Boolean::parseBoolean)
.orElse(false);