public interface ICommandLauncher
Modifier and Type | Field and Description |
---|---|
static int |
COMMAND_CANCELED |
static int |
ILLEGAL_COMMAND |
static int |
OK |
Modifier and Type | Method and Description |
---|---|
Process |
execute(org.eclipse.core.runtime.IPath commandPath,
String[] args,
String[] env,
org.eclipse.core.runtime.IPath workingDirectory,
org.eclipse.core.runtime.IProgressMonitor monitor)
Execute a command
|
String[] |
getCommandArgs()
Returns an array of the command line arguments that were last used to execute a command.
|
String |
getCommandLine()
Returns the constructed command line of the last command executed.
|
Properties |
getEnvironment()
Returns the set of environment variables in the context of which
this launcher will execute commands.
|
String |
getErrorMessage()
Returns a human readable error message corresponding to the last error encountered during command
execution.
|
org.eclipse.core.resources.IProject |
getProject()
Gets the project this launcher is associated with.
|
void |
setErrorMessage(String error)
Sets the human readable error message corresponding to the last error encountered during command
execution.
|
void |
setProject(org.eclipse.core.resources.IProject project)
Sets the project that this launcher is associated with, or
null if there is no such
project. |
void |
showCommand(boolean show)
Sets if the command should be printed out first before executing.
|
int |
waitAndRead(OutputStream out,
OutputStream err)
Deprecated.
|
int |
waitAndRead(OutputStream output,
OutputStream err,
org.eclipse.core.runtime.IProgressMonitor monitor)
Reads output form the process to the streams.
|
static final int COMMAND_CANCELED
static final int ILLEGAL_COMMAND
static final int OK
void setProject(org.eclipse.core.resources.IProject project)
null
if there is no such
project.project
- org.eclipse.core.resources.IProject getProject()
null
if there is no such project.void showCommand(boolean show)
String getErrorMessage()
null
if there has been no error.
The message could be multi-line, however it is NOT guaranteed that it ends with end of line.void setErrorMessage(String error)
error
- A String corresponding to the error message, or null
if the error state is
intended to be cleared.String[] getCommandArgs()
Properties getEnvironment()
String getCommandLine()
Process execute(org.eclipse.core.runtime.IPath commandPath, String[] args, String[] env, org.eclipse.core.runtime.IPath workingDirectory, org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException
env
- The list of environment variables in variable=value format.org.eclipse.core.runtime.CoreException
- if there is an error executing the command.@Deprecated int waitAndRead(OutputStream out, OutputStream err)
waitAndRead(OutputStream, OutputStream, IProgressMonitor)
instead.int waitAndRead(OutputStream output, OutputStream err, org.eclipse.core.runtime.IProgressMonitor monitor)
Copyright (c) IBM Corp. and others 2004, 2020. All Rights Reserved.