jcscoobyrs 2005/10/10 23:14:03
Modified: modules/core/src/java/org/openejb/server Main.java
Log:
Updated per David to have new approach for help and examples.
Revision Changes Path
1.5 +14 -7
openejb1/modules/core/src/java/org/openejb/server/Main.java
Index: Main.java
===================================================================
RCS file:
/scm/openejb/openejb1/modules/core/src/java/org/openejb/server/Main.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- Main.java 29 Aug 2005 07:24:40 -0000 1.4
+++ Main.java 11 Oct 2005 03:14:03 -0000 1.5
@@ -44,12 +44,15 @@
*/
package org.openejb.server;
-import java.util.Properties;
-import java.io.InputStream;
import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
import java.net.URL;
-import org.openejb.util.JarUtils;
+import java.util.Properties;
+
+import org.openejb.cli.CommandFinder;
import org.openejb.loader.SystemInstance;
+import org.openejb.util.JarUtils;
/**
* This class will parse all the command line arguments then
@@ -61,6 +64,8 @@
* @author <a href="mailto:[EMAIL PROTECTED]">David Blevins</a>
*/
public class Main {
+
+ private static final String helpBase = "META-INF/org.openejb.cli/";
public static void main (String args[]) {
@@ -130,7 +135,7 @@
} else {
props.setProperty("openejb.localcopy", "true");
}
- } else if (args[i].equals("-help")) {
+ } else if (args[i].equals("--help")) {
printHelp();
throw new DontStartServerException();
} else if (args[i].equals("-version")) {
@@ -173,10 +178,12 @@
}
System.out.println( header );
+
+
// Internationalize this
try {
- InputStream in = new URL( "resource:/openejb/start.txt"
).openConnection().getInputStream();
+ InputStream in =
Thread.currentThread().getContextClassLoader().getResource(helpBase +
"start.help").openConnection().getInputStream();
int b = in.read();
while (b != -1) {
@@ -201,7 +208,7 @@
// Internationalize this
try {
- InputStream in = new URL(
"resource:/openejb/ejbserver-examples.txt" ).openConnection().getInputStream();
+ InputStream in =
Thread.currentThread().getContextClassLoader().getResource(helpBase +
"start.examples").openConnection().getInputStream();
int b = in.read();
while (b != -1) {