From f0b0f9e8aa92c45cf3df496f10d6c2008760990f Mon Sep 17 00:00:00 2001 From: emmanue1 Date: Sun, 17 Nov 2019 18:52:43 +0100 Subject: [PATCH] Pull request #194: add -Djd-gui.cfg=path/to.jd-gui.cfg --- .../configuration/ConfigurationXmlPersisterProvider.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/src/main/java/org/jd/gui/service/configuration/ConfigurationXmlPersisterProvider.java b/app/src/main/java/org/jd/gui/service/configuration/ConfigurationXmlPersisterProvider.java index 83d93d3c..3e9bee2d 100644 --- a/app/src/main/java/org/jd/gui/service/configuration/ConfigurationXmlPersisterProvider.java +++ b/app/src/main/java/org/jd/gui/service/configuration/ConfigurationXmlPersisterProvider.java @@ -28,6 +28,15 @@ public class ConfigurationXmlPersisterProvider implements ConfigurationPersister protected static final File FILE = getConfigFile(); protected static File getConfigFile() { + String configFilePath = System.getProperty(Constants.CONFIG_FILENAME); + + if (configFilePath != null) { + File configFile = new File(configFilePath); + if (configFile.exists()) { + return configFile; + } + } + if (PlatformService.getInstance().isLinux()) { // See: http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html String xdgConfigHome = System.getenv("XDG_CONFIG_HOME");