diff options
author | Omair Majid <[email protected]> | 2012-10-29 15:01:07 -0400 |
---|---|---|
committer | Omair Majid <[email protected]> | 2012-10-29 15:01:07 -0400 |
commit | 9e461930e968ff765397e564555a2d8891b9eab6 (patch) | |
tree | 0ed71bf3c10fb027085c6e54e3e80dd2bdf619f6 /netx/net/sourceforge | |
parent | 41531bc7b329c19ab770d08153be9d432225aa82 (diff) |
PR1186: System.getProperty("deployment.user.security.trusted.cacerts") is null
Copy deployment configration read into system properties so it is
visibile to target programs.
Diffstat (limited to 'netx/net/sourceforge')
-rw-r--r-- | netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java | 22 | ||||
-rw-r--r-- | netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java | 1 |
2 files changed, 22 insertions, 1 deletions
diff --git a/netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java b/netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java index 8261749..0d4875b 100644 --- a/netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java +++ b/netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java @@ -209,6 +209,12 @@ public final class DeploymentConfiguration { sm.checkRead(userFile.toString()); } + File systemConfigFile = findSystemConfigFile(); + + load(systemConfigFile, userFile, fixIssues); + } + + void load(File systemConfigFile, File userFile, boolean fixIssues) throws ConfigurationException { Map<String, Setting<String>> initialProperties = Defaults.getDefaults(); Map<String, Setting<String>> systemProperties = null; @@ -218,7 +224,6 @@ public final class DeploymentConfiguration { * there is a system-level deployment.poperties file */ - File systemConfigFile = findSystemConfigFile(); if (systemConfigFile != null) { if (loadSystemConfiguration(systemConfigFile)) { if (JNLPRuntime.isDebug()) { @@ -257,6 +262,21 @@ public final class DeploymentConfiguration { } /** + * Copies the current configuration into the target + */ + public void copyTo(Properties target) { + Set<String> names = getAllPropertyNames(); + + for (String name : names) { + String value = getProperty(name); + // for Properties, missing and null are identical + if (value != null) { + target.setProperty(name, value); + } + } + } + + /** * Get the value for the given key * * @param key the property key diff --git a/netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java b/netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java index 113e51b..fedf918 100644 --- a/netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java +++ b/netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java @@ -184,6 +184,7 @@ public class JNLPRuntime { try { config.load(); + config.copyTo(System.getProperties()); } catch (ConfigurationException e) { /* exit if there is a fatal exception loading the configuration */ if (isApplication) { |