* add commons-io.jar to classloader which is needed by commons-fileupload 1.1

* do not fail if we can't get helma install path from launcher.jar, but print a warning.
This commit is contained in:
hns 2006-01-30 16:15:24 +00:00
parent bea5a4a0d0
commit 66016004d1

View file

@ -40,6 +40,7 @@ public class Main {
"crimson.jar", "xmlrpc.jar", "servlet.jar", "crimson.jar", "xmlrpc.jar", "servlet.jar",
"mail.jar", "activation.jar", "mail.jar", "activation.jar",
"commons-fileupload.jar", "commons-codec.jar", "commons-fileupload.jar", "commons-codec.jar",
"commons-io.jar",
"netcomponents.jar", "jimi.jar", "netcomponents.jar", "jimi.jar",
"apache-dom.jar" "apache-dom.jar"
}; };
@ -182,13 +183,14 @@ public class Main {
String jarUrl = launcherUrl.toString(); String jarUrl = launcherUrl.toString();
if (!jarUrl.startsWith("jar:") || jarUrl.indexOf("!") < 0) { if (!jarUrl.startsWith("jar:") || jarUrl.indexOf("!") < 0) {
throw new RuntimeException(" Unable to get JAR URL from " + jarUrl); installDir = System.getProperty("user.dir");
} System.err.println("Warning: Helma install dir not set by -i parameter ");
System.err.println(" and not started from launcher.jar. Using ");
System.err.println(" current working directory as install dir.");
} else {
jarUrl = jarUrl.substring(4); jarUrl = jarUrl.substring(4);
int excl = jarUrl.indexOf("!"); int excl = jarUrl.indexOf("!");
jarUrl = jarUrl.substring(0, excl); jarUrl = jarUrl.substring(0, excl);
launcherUrl = new URL(jarUrl); launcherUrl = new URL(jarUrl);
@ -196,6 +198,7 @@ public class Main {
installDir = f.getParentFile().getCanonicalPath(); installDir = f.getParentFile().getCanonicalPath();
} }
}
// set System property // set System property
System.setProperty("helma.home", installDir); System.setProperty("helma.home", installDir);
// and return install dir // and return install dir