Update of /cvsroot/rails/18xx/rails/util
In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv31004/rails/util
Modified Files:
Config.java
Log Message:
Some restructuring
Index: Config.java
===================================================================
RCS file: /cvsroot/rails/18xx/rails/util/Config.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** Config.java 7 Nov 2009 12:10:37 -0000 1.9
--- Config.java 27 Dec 2009 18:30:31 -0000 1.10
***************
*** 36,39 ****
--- 36,40 ----
public static void setConfigFile(String myConfigFile) {
Config.myConfigFile = myConfigFile;
+ load();
}
***************
*** 41,44 ****
--- 42,55 ----
if (prop.isEmpty() || !loaded) {
+ load();
+ }
+ if (prop.containsKey(key)) return prop.getProperty(key).trim();
+
+ return "";
+ }
+
+ private static void load() {
+
+ if (prop.isEmpty() || !loaded) {
/* List the property files to read here */
load(myConfigFile, false);
***************
*** 47,53 ****
loaded = true;
}
- if (prop.containsKey(key)) return prop.getProperty(key).trim();
-
- return "";
}
--- 58,61 ----
|