public interface IOperatingSystem
This interface is accessible through the
getOperatingSystem
method available directly to all scripts.
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getenv(java.lang.String name)
Gets the value of an environment variable.
|
java.lang.String |
getEnvironment(java.lang.String variable)
Returns the value of a specified environment variable or
null if the variable
is not found in the current process's environment. |
int |
getForegroundLockTimeout()
Gets the foreground lock timeout (in milliseconds) on Windows.
|
int |
getRegistryIntValue(java.lang.String key)
Gets an
integer registry value. |
java.lang.String |
getRegistryValue(java.lang.String key)
Gets a
String registry value. |
java.lang.String |
getVersion()
Returns a description of the operating system, including version information.
|
boolean |
isWindows()
Returns
true if the current operating system is Microsoft Windows. |
void |
setenv(java.lang.String name,
java.lang.String value)
Sets the value of an environment variable.
|
void |
setForegroundLockTimeout(int timeout)
Sets the foreground lock timeout (in milliseconds) on Windows.
|
void |
unsetenv(java.lang.String name)
Sets an environment variable to
null . |
java.lang.String getVersion()
String
is host dependent.java.lang.String getEnvironment(java.lang.String variable)
null
if the variable
is not found in the current process's environment.boolean isWindows()
true
if the current operating system is Microsoft Windows.int getForegroundLockTimeout() throws UnsupportedMethodException, NotSupportedOnUnixException
void setForegroundLockTimeout(int timeout) throws UnsupportedMethodException, NotSupportedOnUnixException
java.lang.String getRegistryValue(java.lang.String key) throws NotSupportedOnUnixException, NoSuchRegistryKeyException
String
registry value.
This is a native function. The input is the full registry path to the desired value.
The specified registry value is assumed to be a String
value, and its
value is returned.
On Windows, the NoSuchRegistryKeyException
is thrown if the given key does not exist or is of the wrong type.
On UNIX, the implementation throws the NotSupportedOnUnixException
.int getRegistryIntValue(java.lang.String key) throws NotSupportedOnUnixException, NoSuchRegistryKeyException
integer
registry value. This is a native function.
The input is the full registry path to the desired value, for example,
"HKEY_CURRENT_USER\Control Panel\Desktop\LowLevelHooksTimeout".
The specified registry value is assumed to be an integer (DWORD
) value.
Its value is returned.
On systems running Windows, the NoSuchRegistryKeyException
is thrown if the key does not exist or is of the wrong type.
On systems running Unix, the NotSupportedOnUnixException
is thrown.java.lang.String getenv(java.lang.String name)
void setenv(java.lang.String name, java.lang.String value)
void unsetenv(java.lang.String name)
null
.