User: user57
Date: 02/03/04 18:43:47
Modified: src/main/org/jboss Main.java
Log:
o Added -P|--properties option to load system properties from the
specified URL
Revision Changes Path
1.4 +23 -3 jboss-system/src/main/org/jboss/Main.java
Index: Main.java
===================================================================
RCS file: /cvsroot/jboss/jboss-system/src/main/org/jboss/Main.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- Main.java 27 Feb 2002 09:24:26 -0000 1.3
+++ Main.java 5 Mar 2002 02:43:47 -0000 1.4
@@ -37,7 +37,7 @@
*
* @author <a href="mailto:[EMAIL PROTECTED]">Marc Fleury</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Jason Dillon</a>
- * @version $Revision: 1.3 $
+ * @version $Revision: 1.4 $
*/
public class Main
{
@@ -131,8 +131,8 @@
private void processCommandLine(final String[] args) throws Exception
{
// set this from a system property or default to jboss
- String programName = System.getProperty("jboss.boot.loader.name", "jboss");
- String sopts = "-:hD:p:n:c:Vj:L:C:";
+ String programName = System.getProperty("program.name", "jboss");
+ String sopts = "-:hD:p:n:c:Vj:L:C:P:";
LongOpt[] lopts =
{
new LongOpt("help", LongOpt.NO_ARGUMENT, null, 'h'),
@@ -143,6 +143,7 @@
new LongOpt("jaxp", LongOpt.REQUIRED_ARGUMENT, null, 'j'),
new LongOpt("library", LongOpt.REQUIRED_ARGUMENT, null, 'L'),
new LongOpt("classpath", LongOpt.REQUIRED_ARGUMENT, null, 'C'),
+ new LongOpt("properties", LongOpt.REQUIRED_ARGUMENT, null, 'P'),
};
Getopt getopt = new Getopt(programName, args, sopts, lopts);
@@ -182,6 +183,7 @@
System.out.println(" -j, --jaxp=<type> Set the JAXP
impl type (ie. crimson)");
System.out.println(" -L, --library=<filename> Add an extra
library to the loaders classpath");
System.out.println(" -C, --classpath=<url> Add an extra
url to the loaders classpath");
+ System.out.println(" -P, --properties=<url> Load system
properties from the given url");
System.out.println();
System.exit(0);
break; // for completeness
@@ -307,7 +309,25 @@
extraClasspath.add(url);
break;
}
+
+ case 'P':
+ {
+ // Set system properties from url/file
+ arg = getopt.getOptarg();
+ URL url;
+ try {
+ url = new URL(arg);
+ }
+ catch (Exception e) {
+ File file = new File(arg);
+ url = file.toURL();
+ }
+ Properties props = System.getProperties();
+ props.load(url.openConnection().getInputStream());
+ break;
+ }
+
default:
// this should not happen,
// if it does throw an error so we know about it
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development