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/jnlp/config | |
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/jnlp/config')
-rw-r--r-- | netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java | 22 |
1 files changed, 21 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 |