From bd2144eb324824ecf40a1f883ff43cec8887d345 Mon Sep 17 00:00:00 2001 From: "Gary D. Gregory" Date: Sat, 31 May 2003 01:02:33 +0000 Subject: [PATCH] Javadoc. git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@137349 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/commons/lang/SystemUtils.java | 155 +++++++++--------- 1 file changed, 78 insertions(+), 77 deletions(-) diff --git a/src/java/org/apache/commons/lang/SystemUtils.java b/src/java/org/apache/commons/lang/SystemUtils.java index fa83ec890..800132d62 100644 --- a/src/java/org/apache/commons/lang/SystemUtils.java +++ b/src/java/org/apache/commons/lang/SystemUtils.java @@ -54,10 +54,11 @@ package org.apache.commons.lang; /** - *

Common System class helpers.

+ *

Helpers for java.lang.System.

* - *

If a particular system property cannot be read due to security - * restrictions, the field will return null.

+ *

If a system property cannot be read due to security restrictions, + * the corresponding field in this class will be set to null + * and a message will be written to System.err.

* * @author Based on code from Avalon Excalibur * @author Based on code from Lucene @@ -66,7 +67,7 @@ * @author Gary Gregory * @author Michael Becke * @since 1.0 - * @version $Id: SystemUtils.java,v 1.14 2003/05/30 01:15:53 ggregory Exp $ + * @version $Id: SystemUtils.java,v 1.15 2003/05/31 01:02:33 ggregory Exp $ */ public class SystemUtils { @@ -76,7 +77,7 @@ public class SystemUtils { *

File encoding, such as Cp1252.

* *

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.

* * @since Java version 1.2. */ @@ -87,7 +88,7 @@ public class SystemUtils { * File separator ("/" on UNIX). *

* 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.

* * @since Java version 1.1. */ @@ -97,63 +98,63 @@ public class SystemUtils { /** * Is 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.

*/ public static final boolean IS_JAVA_1_1 = getJavaVersionMatches("1.1"); /** * Is 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.

*/ public static final boolean IS_JAVA_1_2 = getJavaVersionMatches("1.2"); /** * Is 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.

*/ public static final boolean IS_JAVA_1_3 = getJavaVersionMatches("1.3"); /** * Is 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.

*/ public static final boolean IS_JAVA_1_4 = getJavaVersionMatches("1.4"); /** * Is 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.

*/ public static final boolean IS_JAVA_1_5 = getJavaVersionMatches("1.5"); /** * Is 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.

*/ public static final boolean IS_OS_AIX = getOSMatches("AIX"); /** * Is 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.

*/ public static final boolean IS_OS_HP_UX = getOSMatches("HP-UX"); /** * Is 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.

*/ public static final boolean IS_OS_IRIX = getOSMatches("Irix"); /** * Is 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.

*/ public static final boolean IS_OS_LINUX = getOSMatches("Linux") || getOSMatches("LINUX"); // Windows XP returns 'Windows 2000' just for fun... @@ -161,35 +162,35 @@ public class SystemUtils { /** * Is 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.

*/ public static final boolean IS_OS_MAC = getOSMatches("Mac"); /** * Is 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.

*/ public static final boolean IS_OS_MAC_OSX = getOSMatches("Mac OS X"); /** * Is 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.

*/ public static final boolean IS_OS_OS2 = getOSMatches("OS/2"); /** * Is 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.

*/ public static final boolean IS_OS_SOLARIS = getOSMatches("Solaris"); /** * Is 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.

*/ public static final boolean IS_OS_SUN_OS = getOSMatches("SunOS"); @@ -201,21 +202,21 @@ public class SystemUtils { /** * Is 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.

*/ public static final boolean IS_OS_WINDOWS = getOSMatches("Windows"); /** * Is 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.

*/ public static final boolean IS_OS_WINDOWS_2000 = getOSMatches("Windows", "5.0"); /** * Is 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.

*/ public static final boolean IS_OS_WINDOWS_95 = getOSMatches("Windows 9", "4.0"); // JDK 1.2 running on Windows98 returns 'Windows 95', hence the above @@ -223,7 +224,7 @@ public class SystemUtils { /** * Is 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.

*/ public static final boolean IS_OS_WINDOWS_98 = getOSMatches("Windows 9", "4.1"); // JDK 1.2 running on Windows98 returns 'Windows 95', hence the above @@ -231,7 +232,7 @@ public class SystemUtils { /** * Is 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.

*/ public static final boolean IS_OS_WINDOWS_ME = getOSMatches("Windows", "4.9"); // JDK 1.2 running on WindowsME may return 'Windows 95', hence the above @@ -239,7 +240,7 @@ public class SystemUtils { /** * Is 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.

*/ public static final boolean IS_OS_WINDOWS_NT = getOSMatches("Windows NT"); // Windows 2000 returns 'Windows 2000' but may suffer from same JDK1.2 problem @@ -247,7 +248,7 @@ public class SystemUtils { /** * Is 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.

*/ public static final boolean IS_OS_WINDOWS_XP = getOSMatches("Windows", "5.1"); @@ -256,7 +257,7 @@ public class SystemUtils { * Java class path. *

* 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.

* * @since Java version 1.1. */ @@ -267,7 +268,7 @@ public class SystemUtils { * Java class format version number. *

* 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.

* * @since Java version 1.1. */ @@ -279,7 +280,7 @@ public class SystemUtils { * First in JDK version 1.2. Not used in Sun JDKs after 1.2. *

* 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.

* * @since Java version 1.2. Not used in Sun versions after 1.2. */ @@ -290,7 +291,7 @@ public class SystemUtils { * Path of extension directory or directories. *

* 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.

* * @since Java 1.3 */ @@ -301,7 +302,7 @@ public class SystemUtils { * Java installation directory. *

* 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.

* * @since Java 1.1 */ @@ -312,7 +313,7 @@ public class SystemUtils { * Default temp file path. *

* 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.

* * @since Java 1.2 */ @@ -323,7 +324,7 @@ public class SystemUtils { * List of paths to search when loading libraries. *

* 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.

* * @since Java 1.2 */ @@ -334,7 +335,7 @@ public class SystemUtils { * Java Runtime Environment name. *

* 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.

* * @since Java 1.3 */ @@ -345,7 +346,7 @@ public class SystemUtils { * Java Runtime Environment version. *

* 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.

* * @since Java 1.3 */ @@ -356,7 +357,7 @@ public class SystemUtils { * Java Runtime Environment specification name. *

* 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.

* * @since Java 1.2 */ @@ -367,7 +368,7 @@ public class SystemUtils { * Java Runtime Environment specification vendor. *

* 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.

* * @since Java 1.2 */ @@ -378,7 +379,7 @@ public class SystemUtils { * Java Runtime Environment specification version. *

* 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.

* * @since Java 1.3 */ @@ -389,7 +390,7 @@ public class SystemUtils { * Java vendor-specific string. *

* 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.

* * @since Java 1.1 */ @@ -400,7 +401,7 @@ public class SystemUtils { * Java vendor URL. *

* 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.

* * @since Java 1.1 */ @@ -411,7 +412,7 @@ public class SystemUtils { * Java version number. *

* 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.

* * @since Java 1.1 */ @@ -420,25 +421,25 @@ public class SystemUtils { //----------------------------------------------------------------------- /** * Gets the Java version as a float. - * Example output: + *

Example return values:

* *

- * The field will return zero if JAVA_VERSION is null. + * The field will return zero if {@link #JAVA_VERSION} is null.

*/ public static final float JAVA_VERSION_FLOAT = getJavaVersionAsFloat(); /** * Gets the Java version as an int. - * Example output: + *

Example return values:

* *

- * The field will return zero if JAVA_VERSION is null. + * The field will return zero if {@link #JAVA_VERSION} is null.

*/ public static final int JAVA_VERSION_INT = getJavaVersionAsInt(); @@ -447,7 +448,7 @@ public class SystemUtils { * Java Virtual Machine implementation info. *

* 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.

* * @since Java 1.2 */ @@ -458,7 +459,7 @@ public class SystemUtils { * Java Virtual Machine implementation name. *

* 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.

* * @since Java 1.2 */ @@ -469,7 +470,7 @@ public class SystemUtils { * Java Virtual Machine specification name. *

* 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.

* * @since Java 1.2 */ @@ -480,7 +481,7 @@ public class SystemUtils { * Java Virtual Machine specification vendor. *

* 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.

* * @since Java 1.2 */ @@ -491,7 +492,7 @@ public class SystemUtils { * Java Virtual Machine specification version. *

* 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.

* * @since Java 1.2 */ @@ -502,7 +503,7 @@ public class SystemUtils { * Java Virtual Machine implementation vendor. *

* 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.

* * @since Java 1.2 */ @@ -513,7 +514,7 @@ public class SystemUtils { * Java Virtual Machine implementation version. *

* 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.

* * @since Java 1.2 */ @@ -524,7 +525,7 @@ public class SystemUtils { * Line separator ("\n" on UNIX). *

* 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.

* * @since Java 1.1 */ @@ -535,7 +536,7 @@ public class SystemUtils { * Operating system architecture. *

* 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.

* * @since Java 1.1 */ @@ -546,7 +547,7 @@ public class SystemUtils { * Operating system name. *

* 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.

* * @since Java 1.1 */ @@ -557,7 +558,7 @@ public class SystemUtils { * Operating system version. *

* 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.

* * @since Java 1.1 */ @@ -568,7 +569,7 @@ public class SystemUtils { * Path separator (":" on UNIX). *

* 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.

* * @since Java 1.1 */ @@ -581,7 +582,7 @@ public class SystemUtils { * Renamed to 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.

* * @since Java 1.2 */ @@ -594,7 +595,7 @@ public class SystemUtils { * User's current working directory. *

* 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.

* * @since Java 1.1 */ @@ -605,7 +606,7 @@ public class SystemUtils { * User's home directory. *

* 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.

* * @since Java 1.1 */ @@ -616,7 +617,7 @@ public class SystemUtils { * User's language code, such as 'en'. *

* 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.

* * @since Java 1.2 */ @@ -627,7 +628,7 @@ public class SystemUtils { * User's account name. *

* 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.

* * @since Java 1.1 */ @@ -635,9 +636,9 @@ public class SystemUtils { //----------------------------------------------------------------------- /** - *

Get the Java version number as a float.

+ *

Gets the Java version number as a float.

* - *

Example output:

+ *

Example return values:

*