+ /**
+ * @param inString String to parse
+ * @return int value of String, or 0 if unparseable
+ */
+ private static int parseInt(String inString)
+ {
+ int val = 0;
+ try {
+ val = Integer.parseInt(inString);
+ }
+ catch (Exception e) {} // ignore, value stays zero
+ return val;
+ }
+
+ /** @return File from which config was loaded (or null) */
+ public static File getConfigFile()
+ {
+ return _configFile;
+ }
+
+ /**
+ * @return config Properties object to allow all config values to be saved
+ */
+ public static Properties getAllConfig()
+ {
+ return _configValues;
+ }
+
+ /**
+ * Store the given configuration setting
+ * @param inKey key (from constants)
+ * @param inValue value as string
+ */
+ public static void setConfigString(String inKey, String inValue)
+ {
+ if (inKey != null && !inKey.equals(""))
+ {
+ _configValues.put(inKey, inValue);
+ }
+ }
+
+ /**
+ * Store the given configuration setting
+ * @param inKey key (from constants)
+ * @param inValue value as boolean
+ */
+ public static void setConfigBoolean(String inKey, boolean inValue)
+ {
+ if (inKey != null && !inKey.equals(""))
+ {
+ _configValues.put(inKey, (inValue?"1":"0"));
+ }
+ }
+
+ /**
+ * Store the given configuration setting
+ * @param inKey key (from constants)
+ * @param inValue value as int
+ */
+ public static void setConfigInt(String inKey, int inValue)