From 53acc0edde63d718a15eccb78de112baaea2db4e Mon Sep 17 00:00:00 2001 From: Mathieu Baudier Date: Wed, 22 Jul 2009 17:15:01 +0000 Subject: [PATCH 1/1] Adapt to Windows git-svn-id: https://svn.argeo.org/slc/trunk@2724 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc --- .../slc/lib/detached/DetachedLauncher.java | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/runtime/org.argeo.slc.lib.detached/src/main/java/org/argeo/slc/lib/detached/DetachedLauncher.java b/runtime/org.argeo.slc.lib.detached/src/main/java/org/argeo/slc/lib/detached/DetachedLauncher.java index 505fa6663..d0ceb56b7 100644 --- a/runtime/org.argeo.slc.lib.detached/src/main/java/org/argeo/slc/lib/detached/DetachedLauncher.java +++ b/runtime/org.argeo.slc.lib.detached/src/main/java/org/argeo/slc/lib/detached/DetachedLauncher.java @@ -1,5 +1,7 @@ package org.argeo.slc.lib.detached; +import java.io.File; + import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.argeo.slc.SlcException; @@ -48,9 +50,11 @@ public class DetachedLauncher extends JvmProcess implements BundleContextAware, else getClasspath().add(osgiFramework); + StringBuffer osgiBundles = new StringBuffer(""); StringBuffer osgiLocations = new StringBuffer(""); bundles: for (Bundle bundle : bundleContext.getBundles()) { String name = bundle.getSymbolicName(); + String location = bundle.getLocation(); // Special bundles if (osgibootBundleName.equals(name)) @@ -62,12 +66,22 @@ public class DetachedLauncher extends JvmProcess implements BundleContextAware, else if (xercesBundleName.equals(name) && prependXmlJars) getPBootClasspath().add(asResource(bundle.getLocation())); - if (osgiLocations.length() != 0) - osgiLocations.append(','); - osgiLocations.append(bundle.getLocation()); + if (location.startsWith("file:")) { + File file = new File(location.substring("file:".length())); + if (osgiLocations.length() != 0) + osgiLocations.append(File.pathSeparatorChar); + osgiLocations.append(file.getPath().replace('/', + File.separatorChar)); + } else { + if (osgiBundles.length() != 0) + osgiBundles.append(','); + osgiBundles.append(location.replace('/', File.separatorChar)); + } } getSystemProperties().setProperty("osgi.bundles", + osgiBundles.toString()); + getSystemProperties().setProperty("slc.osgi.locations", osgiLocations.toString()); } -- 2.39.2