/**
* @author Changhyun Lee {@literal <changhyun1.lee@samsung.com>} (S-Core)
+ * @author Gyeongseok Seo {@literal <gyeongseok.seo@samsung.com>} (S-Core)
* <ul>
* <li> initial creation
* <li> thanks to Yoon Kyung Koo
//
// OS ID constants
//
- public final static int WINDOWS = 0x0001;
- public final static int MAC = 0x0002;
- public final static int LINUX = 0x0004;
- public final static int UNIX = 0x0008;
- public final static int AIX = 0x0010;
- public final static int SOLARIS = 0x0020;
+ public final static int WINDOWS = 0x0100;
+ public final static int WINDOWSXP = 0x0101;
+ public final static int WINDOWS7 = 0x0102;
+ public final static int MAC = 0x0200;
+ public final static int LINUX = 0x0400;
+ public final static int UNIX = 0x0800;
+ public final static int AIX = 0x1000;
+ public final static int SOLARIS = 0x2000;
//
// Vendor constants
if (osName.indexOf("WINDOWS") >= 0) {
osID |= OSChecker.WINDOWS;
+ if ( ObjectUtil.equals(osName, "WINDOWS XP") ) {
+ osID |= OSChecker.WINDOWSXP;
+ } else if ( ObjectUtil.equals(osName, "WINDOWS 7") ) {
+ osID |= OSChecker.WINDOWS7;
+ }
} else if (osName.indexOf("MAC") >= 0) {
osID |= OSChecker.MAC;
} else if (osName.indexOf("LINUX") >= 0) {
return ((osID & OSChecker.WINDOWS) > 0);
}
+ public static boolean isWindowsXP() {
+ return (osID == OSChecker.WINDOWSXP);
+ }
+ public static boolean isWindows7() {
+ return (osID == OSChecker.WINDOWS7);
+ }
+
public static boolean isMAC() {
return ((osID & OSChecker.MAC) > 0);
}
return (vendorID == 0);
}
+ /* querying arch */
+ public static boolean is64bit() {
+ boolean is64bit = false;
+ if ( OSChecker.isWindows() ) {
+ is64bit = (System.getenv("ProgramFiles(x86)") != null);
+ } else {
+ is64bit = (System.getProperty("os.arch").indexOf("64") != -1);
+ }
+ return is64bit;
+ }
}