]> git.argeo.org Git - gpl/argeo-slc.git/commitdiff
Adapt to Windows
authorMathieu Baudier <mbaudier@argeo.org>
Wed, 22 Jul 2009 17:15:01 +0000 (17:15 +0000)
committerMathieu Baudier <mbaudier@argeo.org>
Wed, 22 Jul 2009 17:15:01 +0000 (17:15 +0000)
git-svn-id: https://svn.argeo.org/slc/trunk@2724 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc

runtime/org.argeo.slc.lib.detached/src/main/java/org/argeo/slc/lib/detached/DetachedLauncher.java

index 505fa66633f47db757a4bcf13fe0aec970175390..d0ceb56b77cc5175dbb70fa762a49dcd4ed3330d 100644 (file)
@@ -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());
        }