FileDocCategorySizeDatePackage
OS.javaAPI DocGlassfish v2 API3986Fri May 04 22:23:16 BST 2007com.sun.enterprise.config.backup.util

OS

public class OS extends Object
author
bnevins
version

Fields Summary
Constructors Summary
private OS()

	
Methods Summary
private static booleanis(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 booleanisLinux()

		return is("linux");
	
public static booleanisSun()

		return is("sun");
	
public static booleanisUNIX()

		return File.separatorChar == '/";
	
public static booleanisUnix()

		// convenience method...
		return isUNIX();
	
public static booleanisWindows()

		return File.separatorChar == '\\";
	
public static booleanisWindowsForSure()

		return is("windows") && isWindows();
	
public static voidmain(java.lang.String[] args)

param
args the command line arguments

		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());