Class com.symantec.itools.lang.Platform
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.symantec.itools.lang.Platform

Object
   |
   +----com.symantec.itools.lang.Platform

public class Platform
extends Object
The Platform class abstracts varous System properties to provide a consistant set of names. Different vendors provide different values for these System properties which makes it hard to do comparisons against them. The following properties are abstracted: - java.vendor - java.version - os.name - os.version - os.arch The concept of an OS family (eg: Windows NT, Window 95 and Windows 98 are all part of the Windows family) is also introduced. The abstraction is driven by a Symantec style Property file. This file is broken up into three main sections: - vm; abstracts the VM Info - os; abstracts the OS info - machine; abstracts the Architecture info Each section is further broken down by Java vendor. The reasoning behind choosing the Java vendor is that it makes for finer control over the information. If no vendor were used the number of conflicting values and thus the chance for error gets quite large. Trying to combine similar VMs (Symantec and Sun return the same values currently) makes the file too complicated. The Property file is /com/symantec/itools/lang/Platform.properties Any unknown values can easily be added to the property file without having to recompile any code.

Version:
1.0
Author:
Symantec Internet Tools Division
Since:
VCafe 3.0
See Also:
Properties

Variable Index

 o ARCHITECTURE_ALPHA
 o ARCHITECTURE_MIPS
 o ARCHITECTURE_PA_RISC
 o ARCHITECTURE_SPARC
 o ARCHITECTURE_X86
 o JDK_1_1
 o JDK_1_2
 o OS_AIX
 o OS_DIGITAL_UNIX
 o OS_HPUX
 o OS_IRIX
 o OS_LINUX
 o OS_MACINTOSH
 o OS_SOLARIS
 o OS_TYPE_MAC_OS
 o OS_TYPE_UNIX
 o OS_TYPE_WINDOWS
 o OS_WINDOWS_95
 o OS_WINDOWS_98
 o OS_WINDOWS_NT
 o VENDOR_APPLE
Constant representing Apple.
 o VENDOR_DEC
Constant representing Digital.
 o VENDOR_HP
Constant representing Hewlet Packard.
 o VENDOR_IBM
Constant representing IBM.
 o VENDOR_LINUX_PORT
Constant representing the Linux JDK port.
 o VENDOR_MICROSOFT
Constant representing Microsoft.
 o VENDOR_NETSCAPE
Constant representing Netscape.
 o VENDOR_SGI
Constant representing Silicon Graphics.
 o VENDOR_SUN
Constant representing Sun.
 o VENDOR_SYMANTEC
Constant representing Symantec.
 o architecture
The key from the property file; null if unknown
 o javaVendor
The key from the property file; null if unknown
 o javaVersion
The key from the property file; null if unknown
 o osName
The key from the property file; null if unknown.
 o osType
The key from the property file; null if unknown
 o osVersion
The key from the property file; null if unknown
 o properties
Holds the info from the property file.
 o reportErrors
Tell if unknown information should be reported

Constructor Index

 o com.symantec.itools.lang.Platform()

Method Index

 o isArchitecture(String)
 o isJavaVendor(String)
 o isJavaVersion(String)
 o isOSName(String)
 o isOSType(String)
 o main(String[])
This exists for testing purposes only.

Variables

 o ARCHITECTURE_ALPHA
public static final java.lang.String ARCHITECTURE_ALPHA

Since: VCafe 3.0
 o ARCHITECTURE_MIPS
public static final java.lang.String ARCHITECTURE_MIPS

Since: VCafe 3.0
 o ARCHITECTURE_PA_RISC
public static final java.lang.String ARCHITECTURE_PA_RISC

Since: VCafe 3.0
 o ARCHITECTURE_SPARC
public static final java.lang.String ARCHITECTURE_SPARC

Since: VCafe 3.0
 o ARCHITECTURE_X86
public static final java.lang.String ARCHITECTURE_X86

Since: VCafe 3.0
 o JDK_1_1
public static final java.lang.String JDK_1_1

Since: VCafe 3.0
 o JDK_1_2
public static final java.lang.String JDK_1_2

Since: VCafe 3.0
 o OS_AIX
public static final java.lang.String OS_AIX

Since: VCafe 3.0
 o OS_DIGITAL_UNIX
public static final java.lang.String OS_DIGITAL_UNIX

Since: VCafe 3.0
 o OS_HPUX
public static final java.lang.String OS_HPUX

Since: VCafe 3.0
 o OS_IRIX
public static final java.lang.String OS_IRIX

Since: VCafe 3.0
 o OS_LINUX
public static final java.lang.String OS_LINUX

Since: VCafe 3.0
 o OS_MACINTOSH
public static final java.lang.String OS_MACINTOSH

Since: VCafe 3.0
 o OS_SOLARIS
public static final java.lang.String OS_SOLARIS

Since: VCafe 3.0
 o OS_TYPE_MAC_OS
public static final java.lang.String OS_TYPE_MAC_OS

Since: VCafe 3.0
 o OS_TYPE_UNIX
public static final java.lang.String OS_TYPE_UNIX

Since: VCafe 3.0
 o OS_TYPE_WINDOWS
public static final java.lang.String OS_TYPE_WINDOWS

Since: VCafe 3.0
 o OS_WINDOWS_95
public static final java.lang.String OS_WINDOWS_95

Since: VCafe 3.0
 o OS_WINDOWS_98
public static final java.lang.String OS_WINDOWS_98

Since: VCafe 3.0
 o OS_WINDOWS_NT
public static final java.lang.String OS_WINDOWS_NT

Since: VCafe 3.0
 o VENDOR_APPLE
public static final java.lang.String VENDOR_APPLE
Constant representing Apple.

Since: VCafe 3.0
See Also:
javaVendor, isJavaVendor
 o VENDOR_DEC
public static final java.lang.String VENDOR_DEC
Constant representing Digital.

Since: VCafe 3.0
See Also:
javaVendor, isJavaVendor
 o VENDOR_HP
public static final java.lang.String VENDOR_HP
Constant representing Hewlet Packard.

Since: VCafe 3.0
See Also:
javaVendor, isJavaVendor
 o VENDOR_IBM
public static final java.lang.String VENDOR_IBM
Constant representing IBM.

Since: VCafe 3.0
See Also:
javaVendor, isJavaVendor
 o VENDOR_LINUX_PORT
public static final java.lang.String VENDOR_LINUX_PORT
Constant representing the Linux JDK port.

Since: VCafe 3.0
See Also:
javaVendor, isJavaVendor
 o VENDOR_MICROSOFT
public static final java.lang.String VENDOR_MICROSOFT
Constant representing Microsoft.

Since: VCafe 3.0
See Also:
javaVendor, isJavaVendor
 o VENDOR_NETSCAPE
public static final java.lang.String VENDOR_NETSCAPE
Constant representing Netscape.

Since: VCafe 3.0
See Also:
javaVendor, isJavaVendor
 o VENDOR_SGI
public static final java.lang.String VENDOR_SGI
Constant representing Silicon Graphics.

Since: VCafe 3.0
See Also:
javaVendor, isJavaVendor
 o VENDOR_SUN
public static final java.lang.String VENDOR_SUN
Constant representing Sun.

Since: VCafe 3.0
See Also:
javaVendor, isJavaVendor
 o VENDOR_SYMANTEC
public static final java.lang.String VENDOR_SYMANTEC
Constant representing Symantec.

Since: VCafe 3.0
See Also:
javaVendor, isJavaVendor
 o architecture
protected static java.lang.String architecture
The key from the property file; null if unknown

Since: VCafe 3.0
 o javaVendor
protected static java.lang.String javaVendor
The key from the property file; null if unknown

Since: VCafe 3.0
 o javaVersion
protected static java.lang.String javaVersion
The key from the property file; null if unknown

Since: VCafe 3.0
 o osName
protected static java.lang.String osName
The key from the property file; null if unknown.

Since: VCafe 3.0
 o osType
protected static java.lang.String osType
The key from the property file; null if unknown

Since: VCafe 3.0
 o osVersion
protected static java.lang.String osVersion
The key from the property file; null if unknown

Since: VCafe 3.0
 o properties
protected static com.symantec.itools.util.Properties properties
Holds the info from the property file.

Since: VCafe 3.0
 o reportErrors
protected static boolean reportErrors
Tell if unknown information should be reported

Since: VCafe 3.0

Constructors

 o Platform
protected Platform()

Since:
VCafe 3.0

Methods

 o isArchitecture
public static boolean isArchitecture(String arch)

Parameters:
arch - The representation of the OS version. This is the key in the properties file.
Since:
VCafe 3.0
 o isJavaVendor
public static boolean isJavaVendor(String vendor)

Parameters:
vendor - The representation of the Java vendor. This is the key in the properties file.
Since:
VCafe 3.0
 o isJavaVersion
public static boolean isJavaVersion(String version)

Parameters:
version - The representation of the Java version. This is the key in the properties file.
Since:
VCafe 3.0
 o isOSName
public static boolean isOSName(String os)

Parameters:
os - The representation of the OS name. This is the key in the properties file.
Since:
VCafe 3.0
 o isOSType
public static boolean isOSType(String type)

Parameters:
type - The representation of the OS family. This is the key in the properties file.
Since:
VCafe 3.0
 o main
public static void main(String[] argv)
This exists for testing purposes only.

Parameters:
argv - Not used
Since:
VCafe 3.0

All Packages  Class Hierarchy  This Package  Previous  Next  Index