brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From henev...@apache.org
Subject [13/21] git commit: Fix dev mode check for Windows
Date Thu, 26 Jun 2014 11:42:19 GMT
Fix dev mode check for Windows


Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/984d2c15
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/984d2c15
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/984d2c15

Branch: refs/heads/master
Commit: 984d2c157c76306bddb8d901a0b61d2e203d5056
Parents: 230fde4
Author: Svetoslav Neykov <svetoslav.neykov@cloudsoftcorp.com>
Authored: Tue Jun 24 12:03:38 2014 +0300
Committer: Svetoslav Neykov <svetoslav.neykov@cloudsoftcorp.com>
Committed: Wed Jun 25 18:28:55 2014 +0300

----------------------------------------------------------------------
 .../java/brooklyn/launcher/config/BrooklynDevelopmentModes.java | 5 ++++-
 .../java/brooklyn/launcher/config/CustomResourceLocator.java    | 3 ++-
 utils/common/src/main/java/brooklyn/util/os/Os.java             | 3 +++
 3 files changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/984d2c15/usage/launcher/src/main/java/brooklyn/launcher/config/BrooklynDevelopmentModes.java
----------------------------------------------------------------------
diff --git a/usage/launcher/src/main/java/brooklyn/launcher/config/BrooklynDevelopmentModes.java
b/usage/launcher/src/main/java/brooklyn/launcher/config/BrooklynDevelopmentModes.java
index 9bb0d28..7d8f84d 100644
--- a/usage/launcher/src/main/java/brooklyn/launcher/config/BrooklynDevelopmentModes.java
+++ b/usage/launcher/src/main/java/brooklyn/launcher/config/BrooklynDevelopmentModes.java
@@ -1,5 +1,6 @@
 package brooklyn.launcher.config;
 
+import java.io.File;
 import java.util.concurrent.atomic.AtomicBoolean;
 
 import org.slf4j.Logger;
@@ -7,6 +8,7 @@ import org.slf4j.LoggerFactory;
 
 import brooklyn.config.ConfigKey;
 import brooklyn.event.basic.BasicConfigKey;
+import brooklyn.util.os.Os;
 
 public class BrooklynDevelopmentModes {
 
@@ -59,8 +61,9 @@ public class BrooklynDevelopmentModes {
     
     private static boolean computeAutodectectedDevelopmentMode() {
         String cp = System.getProperty("java.class.path");
+        String platformSegment = Os.nativePath(segment);
         if (cp==null) return false;
-        if (cp.endsWith(segment) || cp.contains(segment+":") || cp.contains(segment+";"))
{
+        if (cp.endsWith(platformSegment) || cp.contains(platformSegment+File.pathSeparator))
{
             log.debug("Brooklyn developmentMode autodetected (based on presence of '"+segment+"'
in classpath)");
             return true;
         }

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/984d2c15/usage/launcher/src/main/java/brooklyn/launcher/config/CustomResourceLocator.java
----------------------------------------------------------------------
diff --git a/usage/launcher/src/main/java/brooklyn/launcher/config/CustomResourceLocator.java
b/usage/launcher/src/main/java/brooklyn/launcher/config/CustomResourceLocator.java
index c6e0d4a..6994d0c 100644
--- a/usage/launcher/src/main/java/brooklyn/launcher/config/CustomResourceLocator.java
+++ b/usage/launcher/src/main/java/brooklyn/launcher/config/CustomResourceLocator.java
@@ -11,6 +11,7 @@ import org.slf4j.LoggerFactory;
 import brooklyn.config.ConfigMap;
 import brooklyn.util.ResourceUtils;
 import brooklyn.util.exceptions.Exceptions;
+import brooklyn.util.os.Os;
 
 /** class which allows non-standard locators to be registered for URL's being loaded */
 public class CustomResourceLocator {
@@ -79,7 +80,7 @@ public class CustomResourceLocator {
 
         public SearchingClassPathInDevMode(String urlToSearchFor, String classpathSuffixToSearchFor,
String classpathSuffixToUse) {
             this.urlToSearchFor = urlToSearchFor;
-            this.classpathSuffixToSearchFor = classpathSuffixToSearchFor;
+            this.classpathSuffixToSearchFor = Os.nativePath(classpathSuffixToSearchFor);
             this.classpathSuffixToUse = classpathSuffixToUse;
         }
         

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/984d2c15/utils/common/src/main/java/brooklyn/util/os/Os.java
----------------------------------------------------------------------
diff --git a/utils/common/src/main/java/brooklyn/util/os/Os.java b/utils/common/src/main/java/brooklyn/util/os/Os.java
index a654d95..4883cec 100644
--- a/utils/common/src/main/java/brooklyn/util/os/Os.java
+++ b/utils/common/src/main/java/brooklyn/util/os/Os.java
@@ -475,6 +475,9 @@ public class Os {
         return sep == SEPARATOR_UNIX ||
                sep == SEPARATOR_WIN;
     }
+    
+    public static String nativePath(String path) {
+        return new File(path).getPath();
     }
 
     public static boolean isMicrosoftWindows() {


Mime
View raw message