GP-6349: LaunchSupport now can use application.settingsdir system

property in launch.properties
This commit is contained in:
Ryan Kurtz
2026-01-20 04:39:14 -05:00
parent 76ded15677
commit c561a6f802

View File

@@ -402,6 +402,7 @@ public class AppConfig {
userSettingsDirName += "_location_" + dirName;
}
// Ensure there is a user home directory (there definitely should be)
String userHomeDirPath = System.getProperty("user.home");
if (userHomeDirPath == null || userHomeDirPath.isEmpty()) {
@@ -420,6 +421,20 @@ public class AppConfig {
return new File(userSettingsDir, saveFileName);
}
// Handle application.settingsdir system property
for (String arg : launchProperties.getVmArgList()) {
if (arg.startsWith("-Dapplication.settingsdir")) {
String[] parts = arg.split("=", 2);
if (parts.length == 2) {
String path = parts[1].trim();
if (!path.isEmpty()) {
userSettingsDir = new File(path, appName + "/" + userSettingsDirName);
return new File(userSettingsDir, saveFileName);
}
}
}
}
// Look for XDG environment variable
String xdgConfigHomeDirStr = System.getenv("XDG_CONFIG_HOME");
if (xdgConfigHomeDirStr != null && !xdgConfigHomeDirStr.isEmpty()) {