Package com.globalmentor.java
Class OperatingSystem
java.lang.Object
com.globalmentor.java.OperatingSystem
Utilities for working with operating system-specific attributes.
- Author:
- Garret Wilson
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The temporary directory name.static final String
The property specifying the line separator character for the platform.static final String
The operating system architecture.static final String
The name of the operating system.static final String
The operating system version.static final String
The property for the user's current working directory.static final String
The property for the user's home directory.static final String
The user name property.static final String
The string, "windows", which is a case-insensitive substring of a Windows operating system identification string. -
Constructor Summary
-
Method Summary
-
Field Details
-
LINE_SEPARATOR_PROPERTY
The property specifying the line separator character for the platform.- See Also:
-
JAVA_IO_TMPDIR_PROPERTY
The temporary directory name.- See Also:
-
OS_NAME_PROPERTY
The name of the operating system.- See Also:
-
OS_ARCH_PROPERTY
The operating system architecture.- See Also:
-
OS_VERSION_PROPERTY
The operating system version.- See Also:
-
USER_NAME_PROPERTY
The user name property.- See Also:
-
USER_HOME_PROPERTY
The property for the user's home directory.- See Also:
-
USER_DIR_PROPERTY
The property for the user's current working directory.- See Also:
-
WINDOWS
The string, "windows", which is a case-insensitive substring of a Windows operating system identification string.- See Also:
-
-
Constructor Details
-
OperatingSystem
public OperatingSystem()
-
-
Method Details
-
getLineSeparator
Deprecated.in favor ofSystem.lineSeparator()
.Returns the system line separator string.- Returns:
- The the system line separator string.
- Throws:
SecurityException
- if a security manager exists and itscheckPropertyAccess
method doesn't allow access to this system property.- See Also:
-
getUserHomeDirectory
Returns the home directory of the user.- Returns:
- The user home directory.
- Throws:
SecurityException
- if a security manager exists and itscheckPropertyAccess
method doesn't allow access to this system property.- See Also:
-
getTempDirectory
Returns the system temporary directory- Returns:
- The system temporary directory directory.
- Throws:
SecurityException
- if a security manager exists and itscheckPropertyAccess
method doesn't allow access to this system property.- See Also:
-
getWorkingDirectory
Returns the current directory of the user.- Returns:
- The user's current working directory.
- Throws:
SecurityException
- if a security manager exists and itscheckPropertyAccess
method doesn't allow access to this system property.- See Also:
-
isWindowsOS
public static boolean isWindowsOS()- Returns:
true
if the operating system is a version of Windows.- Throws:
SecurityException
- if a security manager exists and itscheckPropertyAccess
method doesn't allow access to this system property.- See Also:
-
System.lineSeparator()
.