getOS method returns on of the operating system codes:
OS_WINDOWS, OS_LINUX or OS_UNKNOWN
if (os == 0) {
String osname = System.getProperty("os.name").substring(0,3); //$NON-NLS-1$
if (osname.compareToIgnoreCase("win") == 0) { //$NON-NLS-1$
os = OS_WINDOWS;
} else {
if (osname.compareToIgnoreCase("lin") == 0) { //$NON-NLS-1$
os = OS_LINUX;
} else
os = OS_UNKNOWN;
}
}
return os;