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
-
ARCHITECTURE_ALPHA
-
-
ARCHITECTURE_MIPS
-
-
ARCHITECTURE_PA_RISC
-
-
ARCHITECTURE_SPARC
-
-
ARCHITECTURE_X86
-
-
JDK_1_1
-
-
JDK_1_2
-
-
OS_AIX
-
-
OS_DIGITAL_UNIX
-
-
OS_HPUX
-
-
OS_IRIX
-
-
OS_LINUX
-
-
OS_MACINTOSH
-
-
OS_SOLARIS
-
-
OS_TYPE_MAC_OS
-
-
OS_TYPE_UNIX
-
-
OS_TYPE_WINDOWS
-
-
OS_WINDOWS_95
-
-
OS_WINDOWS_98
-
-
OS_WINDOWS_NT
-
-
VENDOR_APPLE
- Constant representing Apple.
-
VENDOR_DEC
- Constant representing Digital.
-
VENDOR_HP
- Constant representing Hewlet Packard.
-
VENDOR_IBM
- Constant representing IBM.
-
VENDOR_LINUX_PORT
- Constant representing the Linux JDK port.
-
VENDOR_MICROSOFT
- Constant representing Microsoft.
-
VENDOR_NETSCAPE
- Constant representing Netscape.
-
VENDOR_SGI
- Constant representing Silicon Graphics.
-
VENDOR_SUN
- Constant representing Sun.
-
VENDOR_SYMANTEC
- Constant representing Symantec.
-
architecture
- The key from the property file; null if unknown
-
javaVendor
- The key from the property file; null if unknown
-
javaVersion
- The key from the property file; null if unknown
-
osName
- The key from the property file; null if unknown.
-
osType
- The key from the property file; null if unknown
-
osVersion
- The key from the property file; null if unknown
-
properties
- Holds the info from the property file.
-
reportErrors
- Tell if unknown information should be reported
-
com.symantec.itools.lang.Platform()
-
-
isArchitecture(String)
-
-
isJavaVendor(String)
-
-
isJavaVersion(String)
-
-
isOSName(String)
-
-
isOSType(String)
-
-
main(String[])
- This exists for testing purposes only.
ARCHITECTURE_ALPHA
public static final java.lang.String ARCHITECTURE_ALPHA
-
- Since:
VCafe 3.0
ARCHITECTURE_MIPS
public static final java.lang.String ARCHITECTURE_MIPS
-
- Since:
VCafe 3.0
ARCHITECTURE_PA_RISC
public static final java.lang.String ARCHITECTURE_PA_RISC
-
- Since:
VCafe 3.0
ARCHITECTURE_SPARC
public static final java.lang.String ARCHITECTURE_SPARC
-
- Since:
VCafe 3.0
ARCHITECTURE_X86
public static final java.lang.String ARCHITECTURE_X86
-
- Since:
VCafe 3.0
JDK_1_1
public static final java.lang.String JDK_1_1
-
- Since:
VCafe 3.0
JDK_1_2
public static final java.lang.String JDK_1_2
-
- Since:
VCafe 3.0
OS_AIX
public static final java.lang.String OS_AIX
-
- Since:
VCafe 3.0
OS_DIGITAL_UNIX
public static final java.lang.String OS_DIGITAL_UNIX
-
- Since:
VCafe 3.0
OS_HPUX
public static final java.lang.String OS_HPUX
-
- Since:
VCafe 3.0
OS_IRIX
public static final java.lang.String OS_IRIX
-
- Since:
VCafe 3.0
OS_LINUX
public static final java.lang.String OS_LINUX
-
- Since:
VCafe 3.0
OS_MACINTOSH
public static final java.lang.String OS_MACINTOSH
-
- Since:
VCafe 3.0
OS_SOLARIS
public static final java.lang.String OS_SOLARIS
-
- Since:
VCafe 3.0
OS_TYPE_MAC_OS
public static final java.lang.String OS_TYPE_MAC_OS
-
- Since:
VCafe 3.0
OS_TYPE_UNIX
public static final java.lang.String OS_TYPE_UNIX
-
- Since:
VCafe 3.0
OS_TYPE_WINDOWS
public static final java.lang.String OS_TYPE_WINDOWS
-
- Since:
VCafe 3.0
OS_WINDOWS_95
public static final java.lang.String OS_WINDOWS_95
-
- Since:
VCafe 3.0
OS_WINDOWS_98
public static final java.lang.String OS_WINDOWS_98
-
- Since:
VCafe 3.0
OS_WINDOWS_NT
public static final java.lang.String OS_WINDOWS_NT
-
- Since:
VCafe 3.0
VENDOR_APPLE
public static final java.lang.String VENDOR_APPLE
- Constant representing Apple.
- Since:
VCafe 3.0
- See Also:
- javaVendor, isJavaVendor
VENDOR_DEC
public static final java.lang.String VENDOR_DEC
- Constant representing Digital.
- Since:
VCafe 3.0
- See Also:
- javaVendor, isJavaVendor
VENDOR_HP
public static final java.lang.String VENDOR_HP
- Constant representing Hewlet Packard.
- Since:
VCafe 3.0
- See Also:
- javaVendor, isJavaVendor
VENDOR_IBM
public static final java.lang.String VENDOR_IBM
- Constant representing IBM.
- Since:
VCafe 3.0
- See Also:
- javaVendor, isJavaVendor
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
VENDOR_MICROSOFT
public static final java.lang.String VENDOR_MICROSOFT
- Constant representing Microsoft.
- Since:
VCafe 3.0
- See Also:
- javaVendor, isJavaVendor
VENDOR_NETSCAPE
public static final java.lang.String VENDOR_NETSCAPE
- Constant representing Netscape.
- Since:
VCafe 3.0
- See Also:
- javaVendor, isJavaVendor
VENDOR_SGI
public static final java.lang.String VENDOR_SGI
- Constant representing Silicon Graphics.
- Since:
VCafe 3.0
- See Also:
- javaVendor, isJavaVendor
VENDOR_SUN
public static final java.lang.String VENDOR_SUN
- Constant representing Sun.
- Since:
VCafe 3.0
- See Also:
- javaVendor, isJavaVendor
VENDOR_SYMANTEC
public static final java.lang.String VENDOR_SYMANTEC
- Constant representing Symantec.
- Since:
VCafe 3.0
- See Also:
- javaVendor, isJavaVendor
architecture
protected static java.lang.String architecture
- The key from the property file; null if unknown
- Since:
VCafe 3.0
javaVendor
protected static java.lang.String javaVendor
- The key from the property file; null if unknown
- Since:
VCafe 3.0
javaVersion
protected static java.lang.String javaVersion
- The key from the property file; null if unknown
- Since:
VCafe 3.0
osName
protected static java.lang.String osName
- The key from the property file; null if unknown.
- Since:
VCafe 3.0
osType
protected static java.lang.String osType
- The key from the property file; null if unknown
- Since:
VCafe 3.0
osVersion
protected static java.lang.String osVersion
- The key from the property file; null if unknown
- Since:
VCafe 3.0
properties
protected static com.symantec.itools.util.Properties properties
- Holds the info from the property file.
- Since:
VCafe 3.0
reportErrors
protected static boolean reportErrors
- Tell if unknown information should be reported
- Since:
VCafe 3.0
Platform
protected Platform()
-
- Since:
- VCafe 3.0
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
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
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
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
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
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