At 9:55 PM -0400 8/9/02, Reimer Mellin wrote:
>In terms of WOStart, its a tiny piece of Code (500 lines incl
>comments), and its already under a pretty generous copyright. Matter
>of fact I planed to post the src on the wof-dev mailing list and
>also write a short article about it on stepwise.
... I've been making pretty heavy use of WOStart for the last several
weeks and have some questions (and some bug fixes/code additions).
I'm not sure woproject-dev is the place to bring this but it's better
than anything else I can think of.
First, a question -- I suspect this is less of a WOStart question
than a more general WO question but, again, here goes. In my
project, I have eight frameworks, one of them carrying all my images
and other webresources. When the application runs, it cannot find
these resources.
A call to 'urlForResourceNamed("images/x.jpg", "ImgFW", null,
null)' returns an unhappy string that starts with
"/ERROR/NOT_FOUND/...". When build 'normally' with Project Builder,
or course, this all works OK. I suspect I need to condition the
ResourceManager to base it's hunt for Web Resources inside the
App.woa directory (in the same spirit that WOStart does for the jars
etc in the Resources in the embedded frameworks).
I suspect this is simple, but if someone has been there before
and has the confidence to know it works, it'll save me hours reading
and testing ...
Second, the code -- here are suggestions and (the last) a bug fix:
public static void main(String[] argv) {
URL[] urls = new URL[] {};
WOStart mainObject = new WOStart(urls);
if (mainObject.getAppRoot() == null) {
System.err.println("Sorry can not find Application directory.
Unable to proceed.");
System.err.println("Current directory or WOStart.class file
should be in or below *.woa directory.");
System.exit(1);
}
else {
System.err.println("Found Application directory at: " +
mainObject.getAppRoot());
}
mainObject.addPatchDirectory(new File(mainObject.getAppRoot(), "Patches"));
mainObject.processWoa();
mainObject.processConfigFile();
mainObject.invokeApplication(argv);
}
____________________________
public File getAppWoa() {
if (this.appWoa == null) {
// start with wOUSerDirectory & user.dir ... find *.woa in path
// if that fails ->path to own class
File aFile = null;
String aDirName = System.getProperty(WOStart.WOUSER_KEY);
if (null != aDirName) {
aFile = new File(aDirName);
aFile = this.findWoa(aFile);
}
if(aFile == null) {
aDirName = System.getProperty(WOStart.CURRENTDIR_KEY);
if (null != aDirName) {
aFile = new File(aDirName);
aFile = this.findWoa(aFile);
}
}
if (aFile == null) {
____________________________
public void processConfigFile() {
String configFilePath = this.getAppRoot() + File.separator +
"Contents/UNIX" + File.separator + "UNIXClassPath.txt";
File configFile = new File(configFilePath);
This archive was generated by hypermail 2.0.0 : Fri Nov 15 2002 - 23:53:18 EST