mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-11-22 07:30:24 +00:00
Add default data dir property
This commit is contained in:
parent
ce5c06c124
commit
7390d3b25c
1 changed files with 3 additions and 1 deletions
|
@ -37,6 +37,7 @@ public class AppProperties {
|
||||||
boolean useVirtualThreads;
|
boolean useVirtualThreads;
|
||||||
boolean debugThreads;
|
boolean debugThreads;
|
||||||
Path dataDir;
|
Path dataDir;
|
||||||
|
Path defaultDataDir;
|
||||||
boolean showcase;
|
boolean showcase;
|
||||||
AppVersion canonicalVersion;
|
AppVersion canonicalVersion;
|
||||||
boolean locatePtb;
|
boolean locatePtb;
|
||||||
|
@ -87,6 +88,7 @@ public class AppProperties {
|
||||||
debugThreads = Optional.ofNullable(System.getProperty("io.xpipe.app.debugThreads"))
|
debugThreads = Optional.ofNullable(System.getProperty("io.xpipe.app.debugThreads"))
|
||||||
.map(Boolean::parseBoolean)
|
.map(Boolean::parseBoolean)
|
||||||
.orElse(false);
|
.orElse(false);
|
||||||
|
defaultDataDir = Path.of(System.getProperty("user.home"), isStaging() ? ".xpipe-ptb" : ".xpipe");
|
||||||
dataDir = Optional.ofNullable(System.getProperty("io.xpipe.app.dataDir"))
|
dataDir = Optional.ofNullable(System.getProperty("io.xpipe.app.dataDir"))
|
||||||
.map(s -> {
|
.map(s -> {
|
||||||
var p = Path.of(s);
|
var p = Path.of(s);
|
||||||
|
@ -95,7 +97,7 @@ public class AppProperties {
|
||||||
}
|
}
|
||||||
return p;
|
return p;
|
||||||
})
|
})
|
||||||
.orElse(Path.of(System.getProperty("user.home"), isStaging() ? ".xpipe-ptb" : ".xpipe"));
|
.orElse(defaultDataDir);
|
||||||
showcase = Optional.ofNullable(System.getProperty("io.xpipe.app.showcase"))
|
showcase = Optional.ofNullable(System.getProperty("io.xpipe.app.showcase"))
|
||||||
.map(Boolean::parseBoolean)
|
.map(Boolean::parseBoolean)
|
||||||
.orElse(false);
|
.orElse(false);
|
||||||
|
|
Loading…
Reference in a new issue