aboutsummaryrefslogtreecommitdiffstats
path: root/netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java
diff options
context:
space:
mode:
Diffstat (limited to 'netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java')
-rw-r--r--netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java29
1 files changed, 25 insertions, 4 deletions
diff --git a/netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java b/netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java
index 98dc88b..61061d2 100644
--- a/netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java
+++ b/netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java
@@ -166,6 +166,7 @@ public final class DeploymentConfiguration {
* JVM arguments for plugin
*/
public static final String KEY_PLUGIN_JVM_ARGUMENTS= "deployment.plugin.jvm.arguments";
+ public static final String KEY_JRE_DIR= "deployment.jre.dir";
public enum ConfigType {
System, User
@@ -178,6 +179,10 @@ public final class DeploymentConfiguration {
private File systemPropertiesFile = null;
/** The user's deployment.config file */
private File userPropertiesFile = null;
+
+ /*default user file*/
+ public static final File USER_DEPLOYMENT_PROPERTIES_FILE = new File(System.getProperty("user.home") + File.separator + DEPLOYMENT_DIR
+ + File.separator + DEPLOYMENT_PROPERTIES);
/** the current deployment properties */
private Map<String, Setting<String>> currentConfiguration;
@@ -221,8 +226,7 @@ public final class DeploymentConfiguration {
*/
public void load(boolean fixIssues) throws ConfigurationException {
// make sure no state leaks if security check fails later on
- File userFile = new File(System.getProperty("user.home") + File.separator + DEPLOYMENT_DIR
- + File.separator + DEPLOYMENT_PROPERTIES);
+ File userFile = new File(USER_DEPLOYMENT_PROPERTIES_FILE.getAbsolutePath());
SecurityManager sm = System.getSecurityManager();
if (sm != null) {
@@ -415,8 +419,25 @@ public final class DeploymentConfiguration {
return etcFile;
}
- File jreFile = new File(System.getProperty("java.home") + File.separator + "lib"
- + File.separator + DEPLOYMENT_CONFIG);
+ String jrePath = null;
+ try {
+ Map<String, Setting<String>> tmpProperties = parsePropertiesFile(USER_DEPLOYMENT_PROPERTIES_FILE);
+ Setting<String> jreSetting = tmpProperties.get(KEY_JRE_DIR);
+ if (jreSetting != null) {
+ jrePath = jreSetting.getValue();
+ }
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ }
+
+ File jreFile;
+ if (jrePath != null) {
+ jreFile = new File(jrePath + File.separator + "lib"
+ + File.separator + DEPLOYMENT_CONFIG);
+ } else {
+ jreFile = new File(System.getProperty("java.home") + File.separator + "lib"
+ + File.separator + DEPLOYMENT_CONFIG);
+ }
if (jreFile.isFile()) {
return jreFile;
}