FileDocCategorySizeDatePackage
SystemUtils.javaAPI DocAndroid 1.5 API1958Wed May 06 22:41:04 BST 2009org.apache.harmony.misc

SystemUtils

public class SystemUtils extends Object
Some system utils

Fields Summary
public static final int
OS_WINDOWS
public static final int
OS_LINUX
public static final int
OS_UNKNOWN
public static final int
ARC_IA32
public static final int
ARC_IA64
public static final int
ARC_UNKNOWN
private static int
os
private static int
arc
Constructors Summary
Methods Summary
public static intgetOS()
getOS method returns on of the operating system codes: OS_WINDOWS, OS_LINUX or OS_UNKNOWN

return
Operating system code


                          
        
        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;