From bd2144eb324824ecf40a1f883ff43cec8887d345 Mon Sep 17 00:00:00 2001
From: "Gary D. Gregory" Common Helpers for If a particular system property cannot be read due to security
- * restrictions, the field will return If a system property cannot be read due to security restrictions,
+ * the corresponding field in this class will be set to File encoding, such as Defaults to System
class helpers.java.lang.System
.null
.null
+ * and a message will be written to System.err
.Cp1252
.null
if the runtime does not have
- * security access to read this property or property not specified.
* Defaults to null
if the runtime does not have
- * security access to read this property or property not specified.
+ * security access to read this property or the property does not exist.
true
if this is Java version 1.1 (also 1.1.x versions).
*
- * The field will return false if JAVA_VERSION
is null
.
+ * The field will return false if {@link #JAVA_VERSION} is null
.
true
if this is Java version 1.2 (also 1.2.x versions).
*
- * The field will return false if JAVA_VERSION
is null
.
+ * The field will return false if {@link #JAVA_VERSION} is null
.
true
if this is Java version 1.3 (also 1.3.x versions).
*
- * The field will return false if JAVA_VERSION
is null
.
+ * The field will return false if {@link #JAVA_VERSION} is null
.
true
if this is Java version 1.4 (also 1.4.x versions).
*
- * The field will return false if JAVA_VERSION
is null
.
+ * The field will return false if {@link #JAVA_VERSION} is null
.
true
if this is Java version 1.5 (also 1.5.x versions).
*
- * The field will return false if JAVA_VERSION
is null
.
+ * The field will return false if {@link #JAVA_VERSION} is null
.
true
if this is AIX.
*
- * The field will return false if OS_NAME
is null
.
+ * The field will return false if OS_NAME
is null
.
true
if this is HP-UX.
*
- * The field will return false if OS_NAME
is null
.
+ * The field will return false if OS_NAME
is null
.
true
if this is Irix.
*
- * The field will return false if OS_NAME
is null
.
+ * The field will return false if OS_NAME
is null
.
true
if this is Linux.
*
- * The field will return false if OS_NAME
is null
.
+ * The field will return false if OS_NAME
is null
.
true
if this is Mac.
*
- * The field will return false if OS_NAME
is null
.
+ * The field will return false if OS_NAME
is null
.
true
if this is Mac.
*
- * The field will return false if OS_NAME
is null
.
+ * The field will return false if OS_NAME
is null
.
true
if this is Mac.
*
- * The field will return false if OS_NAME
is null
.
+ * The field will return false if OS_NAME
is null
.
true
if this is Solaris.
*
- * The field will return false if OS_NAME
is null
.
+ * The field will return false if OS_NAME
is null
.
true
if this is SunOS.
*
- * The field will return false if OS_NAME
is null
.
+ * The field will return false if OS_NAME
is null
.
true
if this is Windows.
*
- * The field will return false if OS_NAME
is null
.
+ * The field will return false if OS_NAME
is null
.
true
if this is Windows 2000.
*
- * The field will return false if OS_NAME
is null
.
+ * The field will return false if OS_NAME
is null
.
true
if this is Windows 95.
*
- * The field will return false if OS_NAME
is null
.
+ * The field will return false if OS_NAME
is null
.
true
if this is Windows 98.
*
- * The field will return false if OS_NAME
is null
.
+ * The field will return false if OS_NAME
is null
.
true
if this is Windows ME.
*
- * The field will return false if OS_NAME
is null
.
+ * The field will return false if OS_NAME
is null
.
true
if this is Windows NT.
*
- * The field will return false if OS_NAME
is null
.
+ * The field will return false if OS_NAME
is null
.
true
if this is Windows XP.
*
- * The field will return false if OS_NAME
is null
.
+ * The field will return false if OS_NAME
is null
.
* Defaults to null
if the runtime does not have
- * security access to read this property or property not specified.
+ * security access to read this property or the property does not exist.
* Defaults to null
if the runtime does not have
- * security access to read this property or property not specified.
+ * security access to read this property or the property does not exist.
* Defaults to null
if the runtime does not have
- * security access to read this property or property not specified.
+ * security access to read this property or the property does not exist.
* Defaults to null
if the runtime does not have
- * security access to read this property or property not specified.
+ * security access to read this property or the property does not exist.
* Defaults to null
if the runtime does not have
- * security access to read this property or property not specified.
+ * security access to read this property or the property does not exist.
* Defaults to null
if the runtime does not have
- * security access to read this property or property not specified.
+ * security access to read this property or the property does not exist.
* Defaults to null
if the runtime does not have
- * security access to read this property or property not specified.
+ * security access to read this property or the property does not exist.
* Defaults to null
if the runtime does not have
- * security access to read this property or property not specified.
+ * security access to read this property or the property does not exist.
* Defaults to null
if the runtime does not have
- * security access to read this property or property not specified.
+ * security access to read this property or the property does not exist.
* Defaults to null
if the runtime does not have
- * security access to read this property or property not specified.
+ * security access to read this property or the property does not exist.
* Defaults to null
if the runtime does not have
- * security access to read this property or property not specified.
+ * security access to read this property or the property does not exist.
* Defaults to null
if the runtime does not have
- * security access to read this property or property not specified.
+ * security access to read this property or the property does not exist.
* Defaults to null
if the runtime does not have
- * security access to read this property or property not specified.
+ * security access to read this property or the property does not exist.
* Defaults to null
if the runtime does not have
- * security access to read this property or property not specified.
+ * security access to read this property or the property does not exist.
* Defaults to null
if the runtime does not have
- * security access to read this property or property not specified.
+ * security access to read this property or the property does not exist.
float
.
- * Example output:
+ * Example return values:
*1.2f
for JDK 1.2
* 1.31f
for JDK 1.3.1
*
- * The field will return zero if JAVA_VERSION
is null
.
+ * The field will return zero if {@link #JAVA_VERSION} is null
.
int
.
- * Example output:
+ * Example return values:
*120
for JDK 1.2
* 131
for JDK 1.3.1
*
- * The field will return zero if JAVA_VERSION
is null
.
+ * The field will return zero if {@link #JAVA_VERSION} is null
.
* Defaults to null
if the runtime does not have
- * security access to read this property or property not specified.
+ * security access to read this property or the property does not exist.
* Defaults to null
if the runtime does not have
- * security access to read this property or property not specified.
+ * security access to read this property or the property does not exist.
* Defaults to null
if the runtime does not have
- * security access to read this property or property not specified.
+ * security access to read this property or the property does not exist.
* Defaults to null
if the runtime does not have
- * security access to read this property or property not specified.
+ * security access to read this property or the property does not exist.
* Defaults to null
if the runtime does not have
- * security access to read this property or property not specified.
+ * security access to read this property or the property does not exist.
* Defaults to null
if the runtime does not have
- * security access to read this property or property not specified.
+ * security access to read this property or the property does not exist.
* Defaults to null
if the runtime does not have
- * security access to read this property or property not specified.
+ * security access to read this property or the property does not exist.
* Defaults to null
if the runtime does not have
- * security access to read this property or property not specified.
+ * security access to read this property or the property does not exist.
* Defaults to null
if the runtime does not have
- * security access to read this property or property not specified.
+ * security access to read this property or the property does not exist.
* Defaults to null
if the runtime does not have
- * security access to read this property or property not specified.
+ * security access to read this property or the property does not exist.
* Defaults to null
if the runtime does not have
- * security access to read this property or property not specified.
+ * security access to read this property or the property does not exist.
* Defaults to null
if the runtime does not have
- * security access to read this property or property not specified.
+ * security access to read this property or the property does not exist.
user.country
in 1.4
*
* Defaults to null
if the runtime does not have
- * security access to read this property or property not specified.
+ * security access to read this property or the property does not exist.
* Defaults to null
if the runtime does not have
- * security access to read this property or property not specified.
+ * security access to read this property or the property does not exist.
* Defaults to null
if the runtime does not have
- * security access to read this property or property not specified.
+ * security access to read this property or the property does not exist.
* Defaults to null
if the runtime does not have
- * security access to read this property or property not specified.
+ * security access to read this property or the property does not exist.
* Defaults to null
if the runtime does not have
- * security access to read this property or property not specified.
+ * security access to read this property or the property does not exist.
Get the Java version number as a float
.
Gets the Java version number as a float
.
Example output:
+ *Example return values:
*1.2f
for JDK 1.2
* 1.31f
for JDK 1.3.1
@@ -652,16 +653,16 @@ public static float getJavaVersion() {
}
/**
- * Get the Java version number as a float
.
Gets the Java version number as a float
.
Example output:
+ *Example return values:
*1.2f
for JDK 1.2
* 1.31f
for JDK 1.3.1
* Patch releases are not reported.
- * Zero is returned if JAVA_VERSION is null
.
null
.
*
* @return the version, for example 1.31f for JDK 1.3.1
*/
@@ -677,16 +678,16 @@ private static float getJavaVersionAsFloat() {
}
/**
- * Get the Java version number as an int
.
Gets the Java version number as an int
.
Example output:
+ *Example return values:
*120
for JDK 1.2
* 131
for JDK 1.3.1
* Patch releases are not reported.
- * Zero is returned if JAVA_VERSION is null
.
null
.
*
* @return the version, for example 131 for JDK 1.3.1
*/
@@ -746,21 +747,21 @@ private static boolean getOSMatches(String osNamePrefix, String osVersionPrefix)
//-----------------------------------------------------------------------
/**
- * Gets a System property, defaulting to the given value if the property
- * cannot be read.
+ * Gets a System property, defaulting to null
if the property
+ * cannot be read. If a SecurityException
is caught, the return
+ * value is null
and a message is written to System.err
.
*
* @param property the system property name
- * @return the system property value or null
if security problem
+ * @return the system property value or null
if a security problem occurs
*/
private static String getSystemProperty(String property) {
try {
return System.getProperty(property);
-
} catch (SecurityException ex) {
// we are not allowed to look at this property
System.err.println(
- "SecurityException thrown when reading system property '" + property
- + "' - property value will default to null"
+ "Caught a SecurityException reading the system property '" + property
+ + "'; the SystemUtils property value will default to null."
);
return null;
}