brooklyn-commits mailing list archives

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

The format is "Windows XX", no microsoft in the name.


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

Branch: refs/heads/master
Commit: f67d7c43da47a2ab6be9f3dcc4f0d0e3cbb69148
Parents: 9b70511
Author: Svetoslav Neykov <svetoslav.neykov@cloudsoftcorp.com>
Authored: Fri Jun 6 18:04:27 2014 +0300
Committer: Svetoslav Neykov <svetoslav.neykov@cloudsoftcorp.com>
Committed: Wed Jun 25 18:28:54 2014 +0300

----------------------------------------------------------------------
 .../common/src/main/java/brooklyn/util/os/Os.java  | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/f67d7c43/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 0d891ee..de3d5b8 100644
--- a/utils/common/src/main/java/brooklyn/util/os/Os.java
+++ b/utils/common/src/main/java/brooklyn/util/os/Os.java
@@ -452,16 +452,15 @@ public class Os {
 
     public static boolean isAbsoluteLocal(String path) {
         if (Os.isMicrosoftWindows()) {
-        	return isAbsoluteWin(path);
+            return isAbsoluteWin(path);
         } else {
-        	return isAbsoluteUnix(path);
+            return isAbsoluteUnix(path);
         }
     }
-    
+
     public static boolean isAbsoluteUnix(String path) {
-    	return 
-        	path.startsWith(SEPARATOR_UNIX) || 
-        	(path.equals("~") || path.startsWith("~/"));
+        return path.startsWith(SEPARATOR_UNIX) ||
+                (path.equals("~") || path.startsWith("~/"));
     }
 
     public static boolean isAbsoluteWin(String path) {
@@ -469,9 +468,9 @@ public class Os {
     }
 
     public static boolean isMicrosoftWindows() {
-        if (System.getProperty("os.name").toLowerCase().indexOf("microsoft")>=0)
-            return true;
-        return false;
+        String os = System.getProperty("os.name").toLowerCase();
+        //see org.apache.commons.lang.SystemUtils.IS_WINDOWS
+        return os.startsWith("windows");
     }
 
     /** creates a private temp file which will be deleted on exit;


Mime
View raw message