Unable to set System properties using java.util.Properties.load()
[code]
/**
* wrapper for {@link java.util.Properties} load
*/
public synchronized void load() {
try {
System.out.println("filePath = " + filePath);
String[] javaClassPathArray =
System.getProperty(filePath).split(separator);
String myFileName;
for (int i = 0; i < javaClassPathArray.length; i++) {
myFileName = javaClassPathArray[i] + File.separator +
className + "globals.properties";
if (FileFunctionality.isFile(myFileName)) {
System.out.println("myFileName = " + myFileName);
// USE PARENT Properties load() METHOD
load(new FileInputStream(myFileName)); // NOT
OVERWRITTEN HERE
System.setProperties(this);
break;
}
}
} catch (Exception e) {
e.printStackTrace();
} // DO NOTHING JUST WON'T LOAD ANYTHING
}
[/code]
Based on tutorials I've read setting new System properties from
a .properties file (see http://www.exampledepot.com/egs/java.util/Props.html
), I am still unable to set new System properties using
a .properties. I can confirm using
System.getProperties().list(System.out) that no such properties exist
in spite of my setting them via this methodology that I learned.
So since this appears to be wrong, what really is the right way to set
System properties using a .properties file?
Thanx
Phil