com.plumtree.openfoundation.platform
Class XPOperatingSystem

java.lang.Object
  extended by com.plumtree.openfoundation.platform.XPOperatingSystem

public class XPOperatingSystem
extends java.lang.Object

Enumerated ordinal type for OS.

Author:
DanielF

Nested Class Summary
protected static class XPOperatingSystem.FileChecker
          Static class to check for existing file path.
 
Field Summary
static XPOperatingSystem AIX
          Static XPOperationSystem object for AIX.
protected static XPOperatingSystem current
          Current working operating system.
static XPOperatingSystem HPUX
          Static XPOperationSystem object for HPUX.
static XPOperatingSystem LINUX_DEBIAN
          Static XPOperationSystem object for Linux (Debian).
static XPOperatingSystem LINUX_FEDORA
          Static XPOperationSystem object for Linux (Fedora).
static XPOperatingSystem LINUX_GENTOO
          Static XPOperationSystem object for Linux (Gentoo).
static XPOperatingSystem LINUX_MANDRAKE
          Static XPOperationSystem object for Linux (Mandrake).
static XPOperatingSystem LINUX_REDHAT
          Static XPOperationSystem object for Linux (Red Hat).
static XPOperatingSystem LINUX_SLACKWARE
          Static XPOperationSystem object for Linux (Slackware).
static XPOperatingSystem LINUX_STANDARDBASE
          Static XPOperationSystem object for Linux (Unknown, Standard Base).
static XPOperatingSystem LINUX_SUNJDS
          Static XPOperationSystem object for Linux (Sun JDS).
static XPOperatingSystem LINUX_SUSE
          Static XPOperationSystem object for Linux (SuSE).
static XPOperatingSystem LINUX_UNIDENTIFIED
          Static XPOperationSystem object for Linux (Unknown, Distro).
static XPOperatingSystem LINUX_YELLOWDOG
          Static XPOperationSystem object for Linux (Yellow Dog).
 int m_id
          ID assigned for new XPOperatingSystem object.
 boolean m_linux
          true if this is a linux system.
 java.lang.String m_name
          OS name for newly created XPOperatingSystem object.
static java.lang.String m_osArch
          Predefined OS name, hardware architecture and version number.
 XPOSFamily m_osFamily
          Major OS types/families.
static java.lang.String m_osName
          Predefined OS name, hardware architecture and version number.
static java.lang.String m_osVersion
          Predefined OS name, hardware architecture and version number.
static XPOperatingSystem MACOSX
          Static XPOperationSystem object for Mac OS X.
static XPOperatingSystem OLDMAC
          Static XPOperationSystem object for Macintosh System 9.
static XPOperatingSystem[] platformList
          Static XPOperationSystem object array for pre-defined operating systems.
static XPOperatingSystem SUNOS_SPARC
          Static XPOperationSystem object for Solaris (Sparc).
static XPOperatingSystem SUNOS_X86
          Static XPOperationSystem object for Solaris (x86).
static XPOperatingSystem UNIDENTIFIED
          Static XPOperationSystem object for unidentified operating system.
static XPOperatingSystem WINDOWS_UNKNOWN
          Static XPOperationSystem object for unknown Windows version.
static XPOperatingSystem WINDOWS2000
          Static XPOperationSystem object for Windows 2000.
static XPOperatingSystem WINDOWS2003
          Static XPOperationSystem object for Windows 2003.
static XPOperatingSystem WINDOWS95
          Static XPOperationSystem object for Windows 95.
static XPOperatingSystem WINDOWS98
          Static XPOperationSystem object for Windows 98.
static XPOperatingSystem WINDOWSME
          Static XPOperationSystem object for Windows Me.
static XPOperatingSystem WINDOWSNT
          Static XPOperationSystem object for Windows NT.
static XPOperatingSystem WINDOWSXP
          Static XPOperationSystem object for Windows XP.
 
Constructor Summary
protected XPOperatingSystem()
           
 
Method Summary
protected static XPOperatingSystem ComputeOS(java.lang.String osName, java.lang.String osArch, java.lang.String osVersion, XPOperatingSystem.FileChecker filecheck)
          Calculates the current OS, using the System properties.
 boolean equals(XPOperatingSystem osFamily)
          Compare current os type with provided XPOperatingSystem object.
 java.lang.String GetName()
          Returns the name of current platform.
static XPOperatingSystem GetOperatingSystem()
          Determine the current operating system object using JVM's system properties.
static XPOperatingSystem GetOS(int id)
          Gets OS by ID.
static java.lang.String GetOSArch()
          Return hardware architecture of current OS.
 XPOSFamily GetOSFamily()
          Return major OS types.
static java.lang.String GetOSName()
          Return currect OS name.
static java.lang.String GetOSVersion()
          Return version number of current OS.
static boolean IsLinux()
          Determine if this is a Linux operating system.
static boolean IsSolaris()
          Determine if this is a Solaris operating system regardless of its hardware architecture.
static boolean IsUnix()
          Find out if current OS belongs to Unix family.
static boolean IsWindows()
          Find out if current OS belongs to Windows family.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_osName

public static java.lang.String m_osName
Predefined OS name, hardware architecture and version number.


m_osArch

public static java.lang.String m_osArch
Predefined OS name, hardware architecture and version number.


m_osVersion

public static java.lang.String m_osVersion
Predefined OS name, hardware architecture and version number.


m_id

public int m_id
ID assigned for new XPOperatingSystem object.


m_name

public java.lang.String m_name
OS name for newly created XPOperatingSystem object.


m_osFamily

public XPOSFamily m_osFamily
Major OS types/families.


m_linux

public boolean m_linux
true if this is a linux system.


current

protected static XPOperatingSystem current
Current working operating system.


WINDOWS_UNKNOWN

public static final XPOperatingSystem WINDOWS_UNKNOWN
Static XPOperationSystem object for unknown Windows version.


WINDOWSNT

public static final XPOperatingSystem WINDOWSNT
Static XPOperationSystem object for Windows NT.


WINDOWS95

public static final XPOperatingSystem WINDOWS95
Static XPOperationSystem object for Windows 95.


WINDOWS98

public static final XPOperatingSystem WINDOWS98
Static XPOperationSystem object for Windows 98.


WINDOWSME

public static final XPOperatingSystem WINDOWSME
Static XPOperationSystem object for Windows Me.


WINDOWS2000

public static final XPOperatingSystem WINDOWS2000
Static XPOperationSystem object for Windows 2000.


WINDOWSXP

public static final XPOperatingSystem WINDOWSXP
Static XPOperationSystem object for Windows XP.


WINDOWS2003

public static final XPOperatingSystem WINDOWS2003
Static XPOperationSystem object for Windows 2003.


MACOSX

public static final XPOperatingSystem MACOSX
Static XPOperationSystem object for Mac OS X.


OLDMAC

public static final XPOperatingSystem OLDMAC
Static XPOperationSystem object for Macintosh System 9.


SUNOS_SPARC

public static final XPOperatingSystem SUNOS_SPARC
Static XPOperationSystem object for Solaris (Sparc).


SUNOS_X86

public static final XPOperatingSystem SUNOS_X86
Static XPOperationSystem object for Solaris (x86).


AIX

public static final XPOperatingSystem AIX
Static XPOperationSystem object for AIX.


HPUX

public static final XPOperatingSystem HPUX
Static XPOperationSystem object for HPUX.


LINUX_SUSE

public static final XPOperatingSystem LINUX_SUSE
Static XPOperationSystem object for Linux (SuSE).


LINUX_REDHAT

public static final XPOperatingSystem LINUX_REDHAT
Static XPOperationSystem object for Linux (Red Hat).


LINUX_FEDORA

public static final XPOperatingSystem LINUX_FEDORA
Static XPOperationSystem object for Linux (Fedora).


LINUX_SLACKWARE

public static final XPOperatingSystem LINUX_SLACKWARE
Static XPOperationSystem object for Linux (Slackware).


LINUX_DEBIAN

public static final XPOperatingSystem LINUX_DEBIAN
Static XPOperationSystem object for Linux (Debian).


LINUX_MANDRAKE

public static final XPOperatingSystem LINUX_MANDRAKE
Static XPOperationSystem object for Linux (Mandrake).


LINUX_YELLOWDOG

public static final XPOperatingSystem LINUX_YELLOWDOG
Static XPOperationSystem object for Linux (Yellow Dog).


LINUX_SUNJDS

public static final XPOperatingSystem LINUX_SUNJDS
Static XPOperationSystem object for Linux (Sun JDS).


LINUX_GENTOO

public static final XPOperatingSystem LINUX_GENTOO
Static XPOperationSystem object for Linux (Gentoo).


LINUX_STANDARDBASE

public static final XPOperatingSystem LINUX_STANDARDBASE
Static XPOperationSystem object for Linux (Unknown, Standard Base).


LINUX_UNIDENTIFIED

public static final XPOperatingSystem LINUX_UNIDENTIFIED
Static XPOperationSystem object for Linux (Unknown, Distro).


UNIDENTIFIED

public static final XPOperatingSystem UNIDENTIFIED
Static XPOperationSystem object for unidentified operating system.


platformList

public static XPOperatingSystem[] platformList
Static XPOperationSystem object array for pre-defined operating systems.

Constructor Detail

XPOperatingSystem

protected XPOperatingSystem()
Method Detail

GetOS

public static XPOperatingSystem GetOS(int id)
Gets OS by ID.

Parameters:
id - ID for expecting XPOperatingSystem object.
Returns:
XPOperatingSystem object corresponding to id value.

GetName

public java.lang.String GetName()
Returns the name of current platform.

Returns:
the name of the platform

equals

public boolean equals(XPOperatingSystem osFamily)
Compare current os type with provided XPOperatingSystem object.

Parameters:
osFamily - the XPOperatingSystem object used to compare current os.
Returns:
true if current os is equal to osFamily, false otherwise.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

GetOperatingSystem

public static XPOperatingSystem GetOperatingSystem()
Determine the current operating system object using JVM's system properties.

Returns:
XPOperatingSystem object for current os.

ComputeOS

protected static XPOperatingSystem ComputeOS(java.lang.String osName,
                                             java.lang.String osArch,
                                             java.lang.String osVersion,
                                             XPOperatingSystem.FileChecker filecheck)
Calculates the current OS, using the System properties.

This info was taken from the JNLP os and arch Value Collection Note: this method doesn't seem to reflect current OS because returned value is depending on user input.

Parameters:
osName - os name to compute the XPOperatingSystem object.
osArch - hardware architecture, used for Solaris only.
osVersion - os version, not used by this function for now.
filecheck - Object to check for existing file on Linux platforms. (Not sure why we need this parameter since FileChecker is static).
Returns:
the computed XPOperatingSystem object.

GetOSFamily

public XPOSFamily GetOSFamily()
Return major OS types. Predefined static values are Windows, Unix and Macintosh System 9.

Returns:
XPOSFamily object of current XPOperatingSystem instance.

IsWindows

public static boolean IsWindows()
Find out if current OS belongs to Windows family.

Returns:
true if current OS belongs to Windows family, false if otherwise.

IsUnix

public static boolean IsUnix()
Find out if current OS belongs to Unix family.

Returns:
true if current OS belongs to Unix family, false if otherwise.

IsLinux

public static boolean IsLinux()
Determine if this is a Linux operating system.

Returns:
true if this is a Linux platform, false if otherwise.

IsSolaris

public static boolean IsSolaris()
Determine if this is a Solaris operating system regardless of its hardware architecture.

Returns:
true if this is a Solaris platform, false if otherwise.

GetOSName

public static java.lang.String GetOSName()
Return currect OS name.

Returns:
String value of current OS name.

GetOSArch

public static java.lang.String GetOSArch()
Return hardware architecture of current OS.

Returns:
String value of hardware architecture.

GetOSVersion

public static java.lang.String GetOSVersion()
Return version number of current OS.

Returns:
String value of version number.


Copyright 2002, 2003, 2004 Plumtree Software Inc. All Rights Reserved.