Windows support
authorMathieu Baudier <mbaudier@argeo.org>
Sun, 4 Feb 2018 21:16:09 +0000 (22:16 +0100)
committerMathieu Baudier <mbaudier@argeo.org>
Sun, 4 Feb 2018 21:16:09 +0000 (22:16 +0100)
dist/argeo-node/rpm/usr/share/node/jjs/cms.js
org.argeo.osgi.boot/src/org/argeo/osgi/boot/OsgiBoot.java

index e1b497f835fe1a85f66b28c19d478e756882fcc1..df64a2556acd84a3473e606699360a30f61a25a5 100755 (executable)
@@ -1,4 +1,4 @@
-var System = Java.type("java.lang.System")
+var System = Java.type("java.lang.System");
 var OsgiBuilder = Java.type("org.argeo.osgi.boot.OsgiBuilder");
 
 var osgi = new OsgiBuilder();
@@ -18,12 +18,14 @@ osgi.conf("org.osgi.framework.bootdelegation", "com.sun.jndi.ldap,"
                + "com.sun.jndi.ldap.sasl," + "com.sun.security.jgss,"
                + "com.sun.jndi.dns," + "com.sun.nio.file," + "com.sun.nio.sctp");
 
+var homeUri = java.nio.file.Paths
+               .get(java.lang.System.getProperty("user.home")).toUri().toString();
 if (typeof app !== 'undefined') {
        if (typeof appHome == 'undefined') {
-               var appHome = $ENV.HOME + "/.a2/var/lib/" + app;
+               var appHome = homeUri + "/.a2/var/lib/" + app;
        }
        if (typeof appConf == 'undefined') {
-               var appConf = $ENV.HOME + "/.a2/etc/" + app;
+               var appConf = homeUri + "/.a2/etc/" + app;
        }
        if (typeof policyFile == 'undefined') {
                var policyFile = "node.policy";
@@ -31,10 +33,8 @@ if (typeof app !== 'undefined') {
        osgi.conf("osgi.configuration.area", appHome + "/state");
        osgi.conf("osgi.instance.area", appHome + "/data");
        System.setProperty("java.security.manager", "");
-       System.setProperty("java.security.policy", "file://" + appConf + "/"
-                       + policyFile);
-       System.setProperty("log4j.configuration", "file://" + appConf
-                       + "/log4j.properties");
+       System.setProperty("java.security.policy", appConf + "/" + policyFile);
+       System.setProperty("log4j.configuration", appConf + "/log4j.properties");
 }
 
 function openWorkbench() {
index b400bf43ad5172318fe3edf733508ab8b0f17d5b..effdcf3baf3bc7daf3e46d0692855a667e93001a 100644 (file)
@@ -19,6 +19,7 @@ import static org.argeo.osgi.boot.OsgiBootUtils.debug;
 import static org.argeo.osgi.boot.OsgiBootUtils.warn;
 
 import java.io.File;
+import java.nio.file.Paths;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.Iterator;
@@ -95,8 +96,8 @@ public class OsgiBoot implements OsgiBootConstants {
        /** Constructor */
        public OsgiBoot(BundleContext bundleContext) {
                this.bundleContext = bundleContext;
-               localCache = getProperty(PROP_ARGEO_OSGI_LOCAL_CACHE,
-                               "file://" + System.getProperty("user.home") + "/.m2/repository/");
+               String homeUri = Paths.get(System.getProperty("user.home")).toUri().toString();
+               localCache = getProperty(PROP_ARGEO_OSGI_LOCAL_CACHE, homeUri + ".m2/repository/");
        }
 
        /*