// add the launch specific application arguments
_appargs.addAll(_envc.appArgs);
+
+ // add startupFiles
+ for (File f : startupFiles) {
+ _appargs.add("-open");
+ _appargs.add(f.getAbsolutePath());
+ }
// look for custom arguments
fillAssignmentListFromPairs("extra.txt", _txtJvmArgs);
{
return new File(appdir, path);
}
+
+ public void addStartupFile (File f) {
+ startupFiles.add(f);
+ }
protected final EnvConfig _envc;
protected File _config;
protected List<String> _jvmargs = new ArrayList<>();
protected List<String> _appargs = new ArrayList<>();
+ protected List<File> startupFiles = new ArrayList<>();
protected String[] _optimumJvmArgs;
}
};
+ public void setStartupFilesFromParameterString(String p) {
+ String q = "\"";
+ if (p != null && p.length() > 0) {
+ String[] filenames;
+ if (p.startsWith(q) && p.endsWith(q)) {
+ filenames = p.substring(1,p.length()-1).split("\" \"");
+ } else {
+ filenames = new String[]{p};
+ }
+ for (int i = 0; i < filenames.length; i++) {
+ String filename = filenames[i];
+ String ext = null;
+ int j = filename.lastIndexOf('.');
+ if (j > -1) {
+ ext = filename.substring(j+1);
+ }
+ // jvp files
+ if (ext.equals("jvp")) {
+ File f = new File(filename);
+ if (f.exists()) {
+ _app.addStartupFile(f);
+ }
+ }
+ // jvl files
+ if (ext.equals("jvl")) {
+ // Do stuff with the appbase here!
+ }
+ }
+ }
+ }
+
protected Application _app;
protected Application.UpdateInterface _ifc = new Application.UpdateInterface(Config.EMPTY);
e.printStackTrace();
}
- Thread.sleep(500);
+ //Thread.sleep(200);
// record a few things for posterity
log.info("------------------ VM Info ------------------");
log.info("-- User Name: " + System.getProperty("user.name"));
log.info("-- User Home: " + System.getProperty("user.home"));
log.info("-- Cur dir: " + System.getProperty("user.dir"));
- log.info("-- JVL: " + System.getProperty("jvl"));
log.info("-- startupFilesParameterString: " + startupFilesParameterString);
log.info("---------------------------------------------");
protected JFrame _frame;
};
+ if (getStartupFilesParameterString() != null) {
+ app.setStartupFilesFromParameterString(getStartupFilesParameterString());
+ }
app.start();
return app;
}
public static void setStartupFilesParameterString(String parameters) {
startupFilesParameterString = parameters;
}
+
+ public static String getStartupFilesParameterString() {
+ return startupFilesParameterString;
+ }
}