Class DefaultProcess
java.lang.Object
net.rubygrapefruit.platform.internal.DefaultProcess
- All Implemented Interfaces:
NativeIntegration, Process
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddetach()Detaches this process from the parent to ignore ctrl-c.getEnvironmentVariable(String name) Get the value of an environment variable.intReturns the process identifier.Returns the process' current working directory.voidsetEnvironmentVariable(String name, String value) Sets the value of an environment variable.voidsetWorkingDirectory(File directory) Sets the process' working directory.
-
Constructor Details
-
DefaultProcess
public DefaultProcess()
-
-
Method Details
-
getProcessId
Description copied from interface:ProcessReturns the process identifier.- Specified by:
getProcessIdin interfaceProcess- Throws:
NativeException- On failure.
-
detach
Description copied from interface:ProcessDetaches this process from the parent to ignore ctrl-c.- Specified by:
detachin interfaceProcess- Throws:
NativeException- On failure.
-
getWorkingDirectory
Description copied from interface:ProcessReturns the process' current working directory.- Specified by:
getWorkingDirectoryin interfaceProcess- Throws:
NativeException- On failure.
-
setWorkingDirectory
Description copied from interface:ProcessSets the process' working directory.- Specified by:
setWorkingDirectoryin interfaceProcess- Throws:
NativeException- On failure.
-
getEnvironmentVariable
Description copied from interface:ProcessGet the value of an environment variable.- Specified by:
getEnvironmentVariablein interfaceProcess- Returns:
- The value or null if no such environment variable. Also returns null for an environment variable whose value is an empty string.
- Throws:
NativeException- On failure.
-
setEnvironmentVariable
Description copied from interface:ProcessSets the value of an environment variable.- Specified by:
setEnvironmentVariablein interfaceProcess- Parameters:
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.- Throws:
NativeException- On failure.
-