org.eclipse.cdt.core
Class CommandLauncher

java.lang.Object
  extended by org.eclipse.cdt.core.CommandLauncher

public class CommandLauncher
extends java.lang.Object


Field Summary
static int COMMAND_CANCELED
           
static int ILLEGAL_COMMAND
           
static int OK
           
 
Constructor Summary
CommandLauncher()
          Creates a new launcher Fills in stderr and stdout output to the given streams.
 
Method Summary
 java.lang.Process execute(org.eclipse.core.runtime.IPath commandPath, java.lang.String[] args, java.lang.String[] env, org.eclipse.core.runtime.IPath changeToDirectory)
          Execute a command
 java.lang.String[] getCommandArgs()
           
 java.lang.String getCommandLine()
          return the constructed Command line.
 java.util.Properties getEnvironment()
           
 java.lang.String getErrorMessage()
           
 void setErrorMessage(java.lang.String error)
           
 void showCommand(boolean show)
          Sets if the command should be printed out first before executing
 int waitAndRead(java.io.OutputStream out, java.io.OutputStream err)
          Reads output form the process to the streams.
 int waitAndRead(java.io.OutputStream output, java.io.OutputStream err, org.eclipse.core.runtime.IProgressMonitor monitor)
          Reads output form the process to the streams.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COMMAND_CANCELED

public static final int COMMAND_CANCELED
See Also:
Constant Field Values

ILLEGAL_COMMAND

public static final int ILLEGAL_COMMAND
See Also:
Constant Field Values

OK

public static final int OK
See Also:
Constant Field Values
Constructor Detail

CommandLauncher

public CommandLauncher()
Creates a new launcher Fills in stderr and stdout output to the given streams. Streams can be set to null, if output not required

Method Detail

showCommand

public void showCommand(boolean show)
Sets if the command should be printed out first before executing


getErrorMessage

public java.lang.String getErrorMessage()

setErrorMessage

public void setErrorMessage(java.lang.String error)

getCommandArgs

public java.lang.String[] getCommandArgs()

getEnvironment

public java.util.Properties getEnvironment()

getCommandLine

public java.lang.String getCommandLine()
return the constructed Command line.

Returns:

execute

public java.lang.Process execute(org.eclipse.core.runtime.IPath commandPath,
                                 java.lang.String[] args,
                                 java.lang.String[] env,
                                 org.eclipse.core.runtime.IPath changeToDirectory)
Execute a command


waitAndRead

public int waitAndRead(java.io.OutputStream out,
                       java.io.OutputStream err)
Reads output form the process to the streams.


waitAndRead

public int waitAndRead(java.io.OutputStream output,
                       java.io.OutputStream err,
                       org.eclipse.core.runtime.IProgressMonitor monitor)
Reads output form the process to the streams. A progress monitor is polled to test if the cancel button has been pressed. Destroys the process if the monitor becomes canceled override to implement a different way to read the process inputs