From 40af4cc6795ab669ec9432d1444f0779f9594952 Mon Sep 17 00:00:00 2001 From: Mathieu Baudier Date: Sun, 4 Feb 2018 22:16:09 +0100 Subject: [PATCH] Windows support --- dist/argeo-node/rpm/usr/share/node/jjs/cms.js | 14 +++++++------- .../src/org/argeo/osgi/boot/OsgiBoot.java | 5 +++-- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/dist/argeo-node/rpm/usr/share/node/jjs/cms.js b/dist/argeo-node/rpm/usr/share/node/jjs/cms.js index e1b497f83..df64a2556 100755 --- a/dist/argeo-node/rpm/usr/share/node/jjs/cms.js +++ b/dist/argeo-node/rpm/usr/share/node/jjs/cms.js @@ -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() { diff --git a/org.argeo.osgi.boot/src/org/argeo/osgi/boot/OsgiBoot.java b/org.argeo.osgi.boot/src/org/argeo/osgi/boot/OsgiBoot.java index b400bf43a..effdcf3ba 100644 --- a/org.argeo.osgi.boot/src/org/argeo/osgi/boot/OsgiBoot.java +++ b/org.argeo.osgi.boot/src/org/argeo/osgi/boot/OsgiBoot.java @@ -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/"); } /* -- 2.30.2