Methods Summary |
---|
private static boolean | is(java.lang.String name)
String osname = System.getProperty("os.name");
if(osname == null || osname.length() <= 0)
return false;
// case insensitive compare...
osname = osname.toLowerCase();
name = name.toLowerCase();
if(osname.indexOf(name) >= 0)
return true;
return false;
|
public static boolean | isLinux()
return is("linux");
|
public static boolean | isSun()
return is("sun");
|
public static boolean | isUNIX()
return File.separatorChar == '/";
|
public static boolean | isUnix()
// convenience method...
return isUNIX();
|
public static boolean | isWindows()
return File.separatorChar == '\\";
|
public static boolean | isWindowsForSure()
return is("windows") && isWindows();
|
public static void | main(java.lang.String[] args)
System.out.println("isUNIX() returned: " + isUNIX());
System.out.println("isWindows() returned: " + isWindows());
System.out.println("isWindowsForSure() returned: " + isWindowsForSure());
System.out.println("isSun() returned: " + isSun());
System.out.println("isLinux() returned: " + isLinux());
|