Unable to set System properties using java.util.Properties.load()
- From: "phillip.s.powell@xxxxxxxxx" <phillip.s.powell@xxxxxxxxx>
- Date: 26 Feb 2007 14:06:22 -0800
[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
.
- Prev by Date: Re: difference between thread and process
- Next by Date: question about Sun Java SE TZupdater tool
- Previous by thread: asp.net webservice j2me ?
- Next by thread: question about Sun Java SE TZupdater tool
- Index(es):