public class WrapperProcess extends java.lang.Object implements Process
Process implementation that wraps another to add thread-safety and to update the JVM's internal view of
various process properties.| Constructor and Description |
|---|
WrapperProcess(Process process,
boolean windows) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getEnvironmentVariable(java.lang.String name)
Get the value of an environment variable.
|
int |
getProcessId()
Returns the process identifier.
|
java.io.File |
getWorkingDirectory()
Returns the process' current working directory.
|
void |
setEnvironmentVariable(java.lang.String name,
java.lang.String value)
Sets the value of an environment variable.
|
void |
setWorkingDirectory(java.io.File directory)
Sets the process' working directory.
|
java.lang.String |
toString() |
public WrapperProcess(Process process, boolean windows)
public java.lang.String toString()
toString in class java.lang.Objectpublic int getProcessId()
throws NativeException
ProcessgetProcessId in interface ProcessNativeException - On failure.public java.io.File getWorkingDirectory()
throws NativeException
ProcessgetWorkingDirectory in interface ProcessNativeException - On failure.public void setWorkingDirectory(java.io.File directory)
throws NativeException
ProcesssetWorkingDirectory in interface ProcessNativeException - On failure.public java.lang.String getEnvironmentVariable(java.lang.String name)
throws NativeException
ProcessgetEnvironmentVariable in interface ProcessNativeException - On failure.public void setEnvironmentVariable(java.lang.String name,
java.lang.String value)
throws NativeException
ProcesssetEnvironmentVariable in interface Processvalue - the new value. Use null or an empty string to remove the environment variable. Note that on some
platforms it is not possible to remove the environment variable safely. On such platforms, the value is set to an
empty string instead.NativeException - On failure.