Loading a configuration file
Loading a configuration file
- Subject: Loading a configuration file
- From: Greg Hulands <email@hidden>
- Date: Thu, 30 Oct 2003 14:31:29 +1000
I am trying to get my wo application to load a configuration file on
startup. I have placed the xml config file in my home directory
(/Users/ghulands/config.xml) but for some reason the wo app never loads
it. It is getting a null pointer exception. I have appended the
arguments with -config /Users/ghulands/config.xml
public Application()
{
super();
System.out.println("Welcome to " + this.name() + "!");
String configFile = System.getProperty("config", null);
if (configFile != null)
{
try {
WOXMLDecoder xDecoder = WOXMLDecoder.decoder();
configuration =
((NSDictionary)xDecoder.decodeRootObject(new NSData(new
FileInputStream(configFile), 1024))).mutableClone();
}
catch (Exception e){
System.out.println("Unable to load configuration file:
" + configFile);
loadDefaults();
}
}
else
{
System.out.println("No configuration file provided.");
loadDefaults();
}
}
Is there an issue with file permissions when running a wo app?
Any help is appreciated,
Greg
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.