net.rubygrapefruit.platform.internal
Class DefaultProcess

java.lang.Object
  extended by net.rubygrapefruit.platform.internal.DefaultProcess
All Implemented Interfaces:
NativeIntegration, Process

public class DefaultProcess
extends java.lang.Object
implements Process


Constructor Summary
DefaultProcess()
           
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultProcess

public DefaultProcess()
Method Detail

getProcessId

public int getProcessId()
                 throws NativeException
Description copied from interface: Process
Returns the process identifier.

Specified by:
getProcessId in interface Process
Throws:
NativeException - On failure.

getWorkingDirectory

public java.io.File getWorkingDirectory()
                                 throws NativeException
Description copied from interface: Process
Returns the process' current working directory.

Specified by:
getWorkingDirectory in interface Process
Throws:
NativeException - On failure.

setWorkingDirectory

public void setWorkingDirectory(java.io.File directory)
                         throws NativeException
Description copied from interface: Process
Sets the process' working directory.

Specified by:
setWorkingDirectory in interface Process
Throws:
NativeException - On failure.

getEnvironmentVariable

public java.lang.String getEnvironmentVariable(java.lang.String name)
                                        throws NativeException
Description copied from interface: Process
Get the value of an environment variable.

Specified by:
getEnvironmentVariable in interface Process
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 NativeException
Description copied from interface: Process
Sets the value of an environment variable.

Specified by:
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.
Throws:
NativeException - On failure.