Class DefaultProcess
- java.lang.Object
-
- net.rubygrapefruit.platform.internal.DefaultProcess
-
- All Implemented Interfaces:
NativeIntegration,Process
public class DefaultProcess extends java.lang.Object implements Process
-
-
Constructor Summary
Constructors Constructor Description DefaultProcess()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddetach()Detaches this process from the parent to ignore ctrl-c.java.lang.StringgetEnvironmentVariable(java.lang.String name)Get the value of an environment variable.intgetProcessId()Returns the process identifier.java.io.FilegetWorkingDirectory()Returns the process' current working directory.voidsetEnvironmentVariable(java.lang.String name, java.lang.String value)Sets the value of an environment variable.voidsetWorkingDirectory(java.io.File directory)Sets the process' working directory.
-
-
-
Method Detail
-
getProcessId
public int getProcessId() throws NativeExceptionDescription copied from interface:ProcessReturns the process identifier.- Specified by:
getProcessIdin interfaceProcess- Throws:
NativeException- On failure.
-
detach
public void detach() throws NativeExceptionDescription copied from interface:ProcessDetaches this process from the parent to ignore ctrl-c.- Specified by:
detachin interfaceProcess- Throws:
NativeException- On failure.
-
getWorkingDirectory
public java.io.File getWorkingDirectory() throws NativeExceptionDescription copied from interface:ProcessReturns the process' current working directory.- Specified by:
getWorkingDirectoryin interfaceProcess- Throws:
NativeException- On failure.
-
setWorkingDirectory
public void setWorkingDirectory(java.io.File directory) throws NativeExceptionDescription copied from interface:ProcessSets the process' working directory.- Specified by:
setWorkingDirectoryin interfaceProcess- Throws:
NativeException- On failure.
-
getEnvironmentVariable
public java.lang.String getEnvironmentVariable(java.lang.String name) throws NativeExceptionDescription 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
public void setEnvironmentVariable(java.lang.String name, java.lang.String value) throws NativeExceptionDescription copied from interface:ProcessSets the value of an environment variable.- Specified by:
setEnvironmentVariablein interfaceProcessvalue- 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.
-
-