/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at legal-notices/CDDLv1_0.txt.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information:
* Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*
*
* Copyright 2006-2008 Sun Microsystems, Inc.
*/
/**
* This class defines an enumeration that may be used to identify
* the operating system on which the JVM is running.
*
* NOTE: to share code this class is used in SetupUtils and should
* not contain any dependency with other classes (not even with
* classes in this package).
* If this class is modified to depend on other classes it will break
* the quicksetup. If this must be done, the references to this
* class in SetupUtils must be removed.
*/
mayInstantiate=false,
mayExtend=false,
mayInvoke=true)
public enum OperatingSystem
{
/**
* The value indicating the AIX operating system.
*/
/**
* The value indicating the FreeBSD operating system.
*/
/**
* The value indicating the HP-UX operating system.
*/
/**
* The value indicating the Linux operating system.
*/
/**
* The value indicating the Mac OS X operating system.
*/
/**
* The value indicating the Solaris operating system.
*/
/**
* The value indicating the Windows operating system.
*/
/**
*/
/**
* The value indicating an unknown operating system.
*/
// The human-readable name for this operating system.
/**
* Creates a new operating system value with the provided name.
*
* @param osName The human-readable name for the operating system.
*/
{
}
/**
* Retrieves the human-readable name of this operating system.
*
* @return The human-readable name for this operating system.
*/
{
return osName;
}
/**
* Retrieves the operating system for the provided name. The name
* provided should come from the <CODE>os.name</CODE> system
* property.
*
* @param osName The name for which to retrieve the corresponding
* operating system.
*
* @return The operating system for the provided name.
*/
{
{
return UNKNOWN;
}
{
return SOLARIS;
}
{
return LINUX;
}
{
return HPUX;
}
{
return AIX;
}
{
return WINDOWS;
}
{
return FREEBSD;
}
{
return MACOS;
}
{
return ZOS;
}
else
{
return UNKNOWN;
}
}
/**
* Indicates whether the provided operating system is UNIX-based.
* UNIX-based operating systems include Solaris, Linux, HP-UX, AIX,
* FreeBSD, and Mac OS X.
*
* @param os The operating system for which to make the
* determination.
*
* @return <CODE>true</CODE> if the provided operating system is
* UNIX-based, or <CODE>false</CODE> if not.
*/
{
switch (os)
{
case SOLARIS:
case LINUX:
case HPUX:
case AIX:
case FREEBSD:
case MACOS:
return true;
default:
return false;
}
}
}