com.izforge.izpack.util
Class OsVersion

java.lang.Object
  extended by com.izforge.izpack.util.OsVersion
All Implemented Interfaces:
OsVersionConstants, StringConstants

public final class OsVersion
extends java.lang.Object
implements OsVersionConstants, StringConstants

This is a convienient class, which helps you to detect / identify the running OS/Distribution

Created at: Date: Nov 9, 2004 Time: 8:53:22 PM

Author:
hani, Marc.Eppelmann@reddot.de

Field Summary
static boolean IS_AIX
          True if this is AIX.
static boolean IS_DEBIAN_LINUX
          True if Debian Linux or derived was detected
static boolean IS_FEDORA_LINUX
          True if Fedora Linux was detected
static boolean IS_FREEBSD
          True if this is FreeBSD.
static boolean IS_HPUX
          True if this is HP-UX.
static boolean IS_LINUX
          True if this is Linux.
static boolean IS_MAC
          True is this is Mac OS
static boolean IS_MANDRAKE_LINUX
          True if Mandriva(Mandrake) Linux was detected
static boolean IS_MANDRIVA_LINUX
          True if Mandrake/Mandriva Linux was detected
static boolean IS_OS2
          True if this is OS/2.
static boolean IS_OSX
          True if this is the Mac OS X.
static boolean IS_PPC
          True if the processor is in the PowerPC family.
static boolean IS_REDHAT_LINUX
          True if RedHat Linux was detected
static boolean IS_SPARC
          True if the processor is in the SPARC family.
static boolean IS_SUNOS
          True if this is SunOS.
static boolean IS_SUNOS_SPARC
          True if this is SunOS / sparc
static boolean IS_SUNOS_X86
          True if this is SunOS / x86
static boolean IS_SUSE_LINUX
          True if SuSE Linux was detected
static boolean IS_UNIX
          True if this is some variant of Unix (OSX, Linux, Solaris, FreeBSD, etc).
static boolean IS_WINDOWS
          True if this is Windows.
static boolean IS_X86
          True if the processor is in the Intel x86 family.
static java.lang.String OS_ARCH
          OS_ARCH = System.getProperty("os.arch")
static java.lang.String OS_NAME
          OS_NAME = System.getProperty( "os.name" )
 
Fields inherited from interface com.izforge.izpack.util.OsVersionConstants
AIX, DEBIAN, FEDORA, FREEBSD, HP_UX, I386, LINUX, MAC, MACOSX, MANDRAKE, MANDRIVA, OS_2, OSARCH, OSNAME, PPC, PROC_VERSION, RED_HAT, REDHAT, SOLARIS, SPARC, SUNOS, SUSE, WINDOWS, X86
 
Fields inherited from interface com.izforge.izpack.util.StringConstants
NL, SP
 
Constructor Summary
OsVersion()
           
 
Method Summary
private static java.lang.String getLinuxDistribution()
          Gets the Details of a Linux Distribution
static java.lang.String getOsDetails()
          returns a String which contains details of known OSs
private static java.lang.String getReleaseFileName()
          Gets the etc Release Filename
static void main(java.lang.String[] args)
          Testmain
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OS_NAME

public static final java.lang.String OS_NAME
OS_NAME = System.getProperty( "os.name" )


OS_ARCH

public static final java.lang.String OS_ARCH
OS_ARCH = System.getProperty("os.arch")


IS_X86

public static final boolean IS_X86
True if the processor is in the Intel x86 family.


IS_PPC

public static final boolean IS_PPC
True if the processor is in the PowerPC family.


IS_SPARC

public static final boolean IS_SPARC
True if the processor is in the SPARC family.


IS_FREEBSD

public static final boolean IS_FREEBSD
True if this is FreeBSD.


IS_LINUX

public static final boolean IS_LINUX
True if this is Linux.


IS_HPUX

public static final boolean IS_HPUX
True if this is HP-UX.


IS_AIX

public static final boolean IS_AIX
True if this is AIX.


IS_SUNOS

public static final boolean IS_SUNOS
True if this is SunOS.


IS_SUNOS_X86

public static final boolean IS_SUNOS_X86
True if this is SunOS / x86


IS_SUNOS_SPARC

public static final boolean IS_SUNOS_SPARC
True if this is SunOS / sparc


IS_OS2

public static final boolean IS_OS2
True if this is OS/2.


IS_MAC

public static final boolean IS_MAC
True is this is Mac OS


IS_OSX

public static final boolean IS_OSX
True if this is the Mac OS X.


IS_WINDOWS

public static final boolean IS_WINDOWS
True if this is Windows.


IS_UNIX

public static final boolean IS_UNIX
True if this is some variant of Unix (OSX, Linux, Solaris, FreeBSD, etc).


IS_REDHAT_LINUX

public static final boolean IS_REDHAT_LINUX
True if RedHat Linux was detected


IS_FEDORA_LINUX

public static final boolean IS_FEDORA_LINUX
True if Fedora Linux was detected


IS_MANDRAKE_LINUX

public static final boolean IS_MANDRAKE_LINUX
True if Mandriva(Mandrake) Linux was detected


IS_MANDRIVA_LINUX

public static final boolean IS_MANDRIVA_LINUX
True if Mandrake/Mandriva Linux was detected


IS_SUSE_LINUX

public static final boolean IS_SUSE_LINUX
True if SuSE Linux was detected


IS_DEBIAN_LINUX

public static final boolean IS_DEBIAN_LINUX
True if Debian Linux or derived was detected

Constructor Detail

OsVersion

public OsVersion()
Method Detail

getReleaseFileName

private static java.lang.String getReleaseFileName()
Gets the etc Release Filename

Returns:
name of the file the release info is stored in for Linux distributions

getLinuxDistribution

private static java.lang.String getLinuxDistribution()
Gets the Details of a Linux Distribution

Returns:
description string of the Linux distribution

getOsDetails

public static java.lang.String getOsDetails()
returns a String which contains details of known OSs

Returns:
the details

main

public static void main(java.lang.String[] args)
Testmain

Parameters:
args - Commandline Args