X-Git-Url: https://git.argeo.org/?a=blobdiff_plain;f=org.argeo.osgi.boot%2Fsrc%2Forg%2Fargeo%2Fosgi%2Fboot%2FNodeRunner.java;h=263a4cda4a429d0f467143640484aa5fb52bde26;hb=25a31ea46e5de6ce0de366fdb999588c6788c540;hp=94fd1fd457fb8671644bc7f05fa14a24808ffe47;hpb=ebd927da42511bb5959000c50a39974c6cfa5f49;p=lgpl%2Fargeo-commons.git diff --git a/org.argeo.osgi.boot/src/org/argeo/osgi/boot/NodeRunner.java b/org.argeo.osgi.boot/src/org/argeo/osgi/boot/NodeRunner.java index 94fd1fd45..263a4cda4 100644 --- a/org.argeo.osgi.boot/src/org/argeo/osgi/boot/NodeRunner.java +++ b/org.argeo.osgi.boot/src/org/argeo/osgi/boot/NodeRunner.java @@ -43,8 +43,8 @@ public class NodeRunner { } this.baseDir = baseDir; - this.confDir = baseDir.resolve("state"); - this.dataDir = baseDir.resolve("data"); + this.confDir = this.baseDir.resolve("state"); + this.dataDir = this.baseDir.resolve("data"); } @@ -121,9 +121,9 @@ public class NodeRunner { private void defaultConfiguration(Map configuration) { // all permissions to OSGi security manager - Path policyFile = confDir.resolve("osgi.policy"); + Path policyFile = confDir.resolve("node.policy"); if (!Files.exists(policyFile)) - copyResource("/org/argeo/osgi/boot/osgi.policy", policyFile); + copyResource("/org/argeo/osgi/boot/node.policy", policyFile); configuration.put("java.security.policy", "file://" + policyFile.toAbsolutePath()); configuration.put("org.eclipse.rap.workbenchAutostart", "false"); @@ -161,20 +161,27 @@ public class NodeRunner { public static void main(String[] args) { try { - // Prepare directories - Path executionDir = Paths.get(System.getProperty("user.dir")); - String distributionUrl; - if (args.length == 0) { - distributionUrl = "org/argeo/commons/org.argeo.dep.cms.sdk/2.1.65/org.argeo.dep.cms.sdk-2.1.65.jar"; - } else { + Path executionDir; + if (args.length == 2) { + distributionUrl = args[0]; + executionDir = Paths.get(args[1]); + } else if (args.length == 1) { + executionDir = Paths.get(System.getProperty("user.dir")); distributionUrl = args[0]; + } else if (args.length == 0) { + executionDir = Paths.get(System.getProperty("user.dir")); + distributionUrl = "org/argeo/commons/org.argeo.dep.cms.sdk/2.1.70/org.argeo.dep.cms.sdk-2.1.70.jar"; + }else{ + printUsage(); + System.exit(1); + return; } NodeRunner nodeRunner = new NodeRunner(distributionUrl, executionDir); nodeRunner.start(); - if (args.length != 0) - System.exit(0); +// if (args.length != 0) +// System.exit(0); } catch (Exception e) { e.printStackTrace(); System.exit(1); @@ -222,4 +229,7 @@ public class NodeRunner { } + static void printUsage(){ + err("Usage: "); + } }