1 17 package org.columba.core.base; 18 19 25 public class OSInfo { 26 private static final String OS_NAME = "os.name"; 28 private static final String OS_ARCH = "os.arch"; 30 32 41 public static boolean isWin32Platform() { 42 return (isWindowsPlatform() || isWinNTPlatform()); 43 } 44 45 55 public static boolean isWinNTPlatform() { 56 return (isWinNT() || isWin2K() || isWin2K3() || isWinXP()); 57 } 58 59 68 public static boolean isWindowsPlatform() { 69 return (isWin95() || isWin98() || isWinME()); 70 } 71 72 74 79 public static boolean isWin95() { 80 return "Windows 95".equalsIgnoreCase(System.getProperty(OS_NAME)); } 82 83 88 public static boolean isWin98() { 89 return "Windows 98".equalsIgnoreCase(System.getProperty(OS_NAME)); } 91 92 97 public static boolean isWinME() { 98 return "Windows ME".equalsIgnoreCase(System.getProperty(OS_NAME)); } 100 101 106 public static boolean isWinNT() { 107 return "Windows NT".equalsIgnoreCase(System.getProperty(OS_NAME)); } 109 110 115 public static boolean isWin2K() { 116 return "Windows 2000".equalsIgnoreCase(System.getProperty(OS_NAME)); } 118 119 124 public static boolean isWin2K3() { 125 return "Windows 2003".equalsIgnoreCase(System.getProperty(OS_NAME)); } 127 128 133 public static boolean isWinXP() { 134 return "Windows XP".equalsIgnoreCase(System.getProperty(OS_NAME)); } 136 137 142 public static boolean isLinux() { 143 return "Linux".equalsIgnoreCase(System.getProperty(OS_NAME)); } 145 146 151 public static boolean isSolaris() { 152 return "Solaris".equalsIgnoreCase(System.getProperty(OS_NAME)); } 154 155 160 public static boolean isMac() { 161 return System.getProperty(OS_NAME).toLowerCase().indexOf("mac") != -1; } 163 164 public static boolean isAMD64Bit() { 165 return System.getProperty(OS_ARCH).toLowerCase().indexOf("amd64") != -1; } 167 } 168 | Popular Tags |