NativeIntegration
, Process
public class DefaultProcess extends Object implements Process
Constructor | Description |
---|---|
DefaultProcess() |
Modifier and Type | Method | Description |
---|---|---|
void |
detach() |
Detaches this process from the parent to ignore ctrl-c.
|
String |
getEnvironmentVariable(String name) |
Get the value of an environment variable.
|
int |
getProcessId() |
Returns the process identifier.
|
File |
getWorkingDirectory() |
Returns the process' current working directory.
|
void |
setEnvironmentVariable(String name,
String value) |
Sets the value of an environment variable.
|
void |
setWorkingDirectory(File directory) |
Sets the process' working directory.
|
public int getProcessId() throws NativeException
Process
getProcessId
in interface Process
NativeException
- On failure.public void detach() throws NativeException
Process
detach
in interface Process
NativeException
- On failure.public File getWorkingDirectory() throws NativeException
Process
getWorkingDirectory
in interface Process
NativeException
- On failure.public void setWorkingDirectory(File directory) throws NativeException
Process
setWorkingDirectory
in interface Process
NativeException
- On failure.public String getEnvironmentVariable(String name) throws NativeException
Process
getEnvironmentVariable
in interface Process
NativeException
- On failure.public void setEnvironmentVariable(String name, String value) throws NativeException
Process
setEnvironmentVariable
in interface Process
value
- 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.