From 901b1c03e2e6385672a5cf0b25c0a63817b1d7fc Mon Sep 17 00:00:00 2001 From: vsolanki Date: Mon, 19 Nov 2018 09:07:01 -0500 Subject: [PATCH 1/2] Introduced a new option called sysargs to bootstrap.properties to allow the setting of system properties during the bootstrap setup Usage: sysargs = [key1]:[val1], [key2]:[val2], [key3] --- .../com/threerings/getdown/data/EnvConfig.java | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/com/threerings/getdown/data/EnvConfig.java b/core/src/main/java/com/threerings/getdown/data/EnvConfig.java index add63aa..450f9ba 100644 --- a/core/src/main/java/com/threerings/getdown/data/EnvConfig.java +++ b/core/src/main/java/com/threerings/getdown/data/EnvConfig.java @@ -53,7 +53,7 @@ public final class EnvConfig { String appDir = null, appDirProv = null; String appId = null, appIdProv = null; String appBase = null, appBaseProv = null; - + String[] sysargs; // start with bootstrap.properties config, if avaialble try { ResourceBundle bundle = ResourceBundle.getBundle("bootstrap"); @@ -74,6 +74,22 @@ public final class EnvConfig { appBase = bundle.getString("appbase"); appBaseProv = "bootstrap.properties"; } + + // Set system properties. Should be in the form: + // sysargs = [key1]:[val1] , [key2]:[val2], [key3] + if (bundle.containsKey("sysargs")) { + sysargs = bundle.getString("sysargs").split(","); + + for (String sysarg : sysargs) { + String[] arg_value = sysarg.trim().split(":", 2); + if(arg_value.length == 2){ + System.setProperty(arg_value[0], arg_value[1]); + }else if(arg_value.length == 1) { + System.setProperty(arg_value[0], ""); + } + } + } + } catch (MissingResourceException e) { // bootstrap.properties is optional; no need for a warning } From 94d7852324b3e37dc4db82ebf178e102bf126d8b Mon Sep 17 00:00:00 2001 From: vsolanki Date: Mon, 19 Nov 2018 10:40:06 -0500 Subject: [PATCH 2/2] Typo --- core/src/main/java/com/threerings/getdown/data/Application.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/java/com/threerings/getdown/data/Application.java b/core/src/main/java/com/threerings/getdown/data/Application.java index 0327b79..271a3f9 100644 --- a/core/src/main/java/com/threerings/getdown/data/Application.java +++ b/core/src/main/java/com/threerings/getdown/data/Application.java @@ -1475,7 +1475,7 @@ public class Application * * @param sigVersion if {@code 0} no validation will be performed, if {@code > 0} then this * should indicate the version of the digest file being validated which indicates which - * algorithm to use to verify the signature. See {@link Digest#VESRION}. + * algorithm to use to verify the signature. See {@link Digest#VERSION}. */ protected void downloadControlFile (String path, int sigVersion) throws IOException