Well, no, that was silly. The application arguments go after the class
name.
This commit is contained in:
@@ -164,7 +164,7 @@ public class Application
|
||||
*/
|
||||
public Application (File appdir, String appid)
|
||||
{
|
||||
this(appdir, appid, null, null);
|
||||
this(appdir, appid, null, null, null);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -177,8 +177,10 @@ public class Application
|
||||
* the primary application.
|
||||
* @param signers an array of possible signers of this application. Used to verify the digest.
|
||||
* @param jvmargs arguments to pass on to launched jvms
|
||||
* @param appargs arguments to pass on to launched application
|
||||
*/
|
||||
public Application (File appdir, String appid, Object[] signers, String[] jvmargs)
|
||||
public Application (
|
||||
File appdir, String appid, Object[] signers, String[] jvmargs, String[] appargs)
|
||||
{
|
||||
_appdir = appdir;
|
||||
_appid = appid;
|
||||
@@ -187,6 +189,9 @@ public class Application
|
||||
if (jvmargs != null) {
|
||||
_baseJvmArgs = jvmargs;
|
||||
}
|
||||
if (appargs != null) {
|
||||
_baseAppArgs = appargs;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -567,6 +572,11 @@ public class Application
|
||||
}
|
||||
}
|
||||
|
||||
// add the launch specific application arguments
|
||||
for (String arg : _baseAppArgs) {
|
||||
_appargs.add(arg);
|
||||
}
|
||||
|
||||
// look for custom arguments
|
||||
fillAssignmentListFromPairs("extra.txt", _jvmargs);
|
||||
|
||||
@@ -1461,6 +1471,7 @@ public class Application
|
||||
protected ArrayList<String> _appargs = new ArrayList<String>();
|
||||
|
||||
protected String[] _baseJvmArgs = new String[0];
|
||||
protected String[] _baseAppArgs = new String[0];
|
||||
|
||||
protected Object[] _signers;
|
||||
|
||||
|
||||
@@ -88,10 +88,11 @@ public abstract class Getdown extends Thread
|
||||
|
||||
public Getdown (File appDir, String appId)
|
||||
{
|
||||
this(appDir, appId, null, null);
|
||||
this(appDir, appId, null, null, null);
|
||||
}
|
||||
|
||||
public Getdown (File appDir, String appId, Object[] signers, String[] jvmargs)
|
||||
public Getdown (
|
||||
File appDir, String appId, Object[] signers, String[] jvmargs, String[] appargs)
|
||||
{
|
||||
super("Getdown");
|
||||
try {
|
||||
@@ -120,7 +121,7 @@ public abstract class Getdown extends Thread
|
||||
"\nis invalid. The directory must not contain the '!' character. Please reinstall.";
|
||||
fail(errmsg);
|
||||
}
|
||||
_app = new Application(appDir, appId, signers, jvmargs);
|
||||
_app = new Application(appDir, appId, signers, jvmargs, appargs);
|
||||
_startup = System.currentTimeMillis();
|
||||
}
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ public class GetdownApp
|
||||
if (StringUtil.isBlank(adarg)) {
|
||||
if (args.length < 1) {
|
||||
System.err.println(
|
||||
"Usage: java -jar getdown.jar app_dir [app_id] [jvm args]");
|
||||
"Usage: java -jar getdown.jar app_dir [app_id] [app args]");
|
||||
System.exit(-1);
|
||||
}
|
||||
adarg = args[aidx++];
|
||||
@@ -68,9 +68,9 @@ public class GetdownApp
|
||||
}
|
||||
|
||||
// pass along anything after that as jvm args
|
||||
String[] jvmargs = null;
|
||||
String[] appargs = null;
|
||||
if (args.length > aidx) {
|
||||
jvmargs = ArrayUtil.splice(args, 0, aidx);
|
||||
appargs = ArrayUtil.splice(args, 0, aidx);
|
||||
}
|
||||
|
||||
// ensure a valid directory was supplied
|
||||
@@ -106,7 +106,7 @@ public class GetdownApp
|
||||
log.info("---------------------------------------------");
|
||||
|
||||
try {
|
||||
Getdown app = new Getdown(appDir, appId, null, jvmargs) {
|
||||
Getdown app = new Getdown(appDir, appId, null, null, appargs) {
|
||||
@Override
|
||||
protected Container createContainer () {
|
||||
// create our user interface, and display it
|
||||
|
||||
@@ -60,7 +60,7 @@ public class GetdownApplet extends JApplet
|
||||
// a third party to insert a trusted certificate. This should be replaced with
|
||||
// statically included trusted keys.
|
||||
_getdown = new Getdown(_config.appdir, null, GetdownApplet.class.getSigners(),
|
||||
_config.jvmargs) {
|
||||
_config.jvmargs, null) {
|
||||
@Override
|
||||
protected Container createContainer () {
|
||||
getContentPane().removeAll();
|
||||
|
||||
Reference in New Issue
Block a user