You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@karaf.apache.org by jb...@apache.org on 2015/11/05 15:07:49 UTC

[1/2] karaf git commit: Convert the repo path to unix separators for boot feature repos.

Repository: karaf
Updated Branches:
  refs/heads/master 55bcb232d -> 91b1d5946


Convert the repo path to unix separators for boot feature repos.


Project: http://git-wip-us.apache.org/repos/asf/karaf/repo
Commit: http://git-wip-us.apache.org/repos/asf/karaf/commit/fda18072
Tree: http://git-wip-us.apache.org/repos/asf/karaf/tree/fda18072
Diff: http://git-wip-us.apache.org/repos/asf/karaf/diff/fda18072

Branch: refs/heads/master
Commit: fda180722d95071baa579778249b3b1a5d902d51
Parents: d784a9b
Author: Andreas Kuhtz <an...@gmail.com>
Authored: Tue Oct 13 10:46:40 2015 +0200
Committer: Andreas Kuhtz <an...@gmail.com>
Committed: Tue Oct 13 10:46:40 2015 +0200

----------------------------------------------------------------------
 .../internal/service/BootFeaturesInstaller.java | 36 ++++++++++++++++++++
 1 file changed, 36 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/karaf/blob/fda18072/features/core/src/main/java/org/apache/karaf/features/internal/service/BootFeaturesInstaller.java
----------------------------------------------------------------------
diff --git a/features/core/src/main/java/org/apache/karaf/features/internal/service/BootFeaturesInstaller.java b/features/core/src/main/java/org/apache/karaf/features/internal/service/BootFeaturesInstaller.java
index 9c1e8fd..f3b1647 100644
--- a/features/core/src/main/java/org/apache/karaf/features/internal/service/BootFeaturesInstaller.java
+++ b/features/core/src/main/java/org/apache/karaf/features/internal/service/BootFeaturesInstaller.java
@@ -16,6 +16,7 @@
  */
 package org.apache.karaf.features.internal.service;
 
+import java.io.File;
 import java.net.URI;
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -42,8 +43,23 @@ public class BootFeaturesInstaller {
     private final String repositories;
     private final String features;
     private final boolean asynchronous;
+    
+    /**
+     * The Unix separator character.
+     */
+    private static final char UNIX_SEPARATOR = '/';
+
+    /**
+     * The Windows separator character.
+     */
+    private static final char WINDOWS_SEPARATOR = '\\';
 
     /**
+     * The system separator character.
+     */
+    private static final char SYSTEM_SEPARATOR = File.separatorChar;
+    
+    /**
      * @param features list of boot features separated by comma. Optionally contains ;version=x.x.x to specify a specific feature version
      */
     public BootFeaturesInstaller(BundleContext bundleContext,
@@ -82,6 +98,7 @@ public class BootFeaturesInstaller {
             for (String repo : repositories.split(",")) {
                 repo = repo.trim();
                 if (!repo.isEmpty()) {
+                    repo = separatorsToUnix(repo);
                     try {
                         featuresService.addRepository(URI.create(repo));
                     } catch (Exception e) {
@@ -141,4 +158,23 @@ public class BootFeaturesInstaller {
         }
     }
 
+    //-----------------------------------------------------------------------
+    /**
+     * Converts all separators to the Unix separator of forward slash.
+     * 
+     * @param path  the path to be changed, null ignored
+     * @return the updated path
+     */
+    private String separatorsToUnix(String path) {
+        if (SYSTEM_SEPARATOR == WINDOWS_SEPARATOR) {
+            // running under windows
+            if (path == null || path.indexOf(WINDOWS_SEPARATOR) == -1) {
+                return path;
+            }
+            
+            path = path.replace(WINDOWS_SEPARATOR, UNIX_SEPARATOR);
+            LOGGER.debug("Converted path to unix separators: {}", path);
+        }
+        return path;
+    }
 }


[2/2] karaf git commit: Merge branch 'KARAF-3961' of https://github.com/akuhtz/karaf

Posted by jb...@apache.org.
Merge branch 'KARAF-3961' of https://github.com/akuhtz/karaf


Project: http://git-wip-us.apache.org/repos/asf/karaf/repo
Commit: http://git-wip-us.apache.org/repos/asf/karaf/commit/91b1d594
Tree: http://git-wip-us.apache.org/repos/asf/karaf/tree/91b1d594
Diff: http://git-wip-us.apache.org/repos/asf/karaf/diff/91b1d594

Branch: refs/heads/master
Commit: 91b1d5946cdac5ef4cca9c6f02ec962d5b259ee1
Parents: 55bcb23 fda1807
Author: Jean-Baptiste Onofré <jb...@apache.org>
Authored: Thu Nov 5 14:46:24 2015 +0100
Committer: Jean-Baptiste Onofré <jb...@apache.org>
Committed: Thu Nov 5 14:46:24 2015 +0100

----------------------------------------------------------------------
 .../internal/service/BootFeaturesInstaller.java | 36 ++++++++++++++++++++
 1 file changed, 36 insertions(+)
----------------------------------------------------------------------