API Overview API Index Package Overview Direct link to this page
Apache Ant 1.7.1
  org.apache.tools.ant.taskdefs. Execute View Source
Author(s)
Since
Ant 1.2
Version
Serial
Hierarchy
 Object
      Execute
Implements
Subclasses
Description
public class Execute
  Runs an external program.
See also:   
Constructors
public Execute ()
Creates a new execute object using PumpStreamHandler for stream handling.
public Execute (ExecuteStreamHandler streamHandler)
  Creates a new execute object.
public Execute (ExecuteStreamHandler streamHandler, ExecuteWatchdog watchdog)
  Creates a new execute object.
Methods
Hide/Show inherited methods
publicstatic void closeStreams (java.lang.Process process)
  Close the streams belonging to the given Process.
public int execute () throws java.io.IOException
  Runs a process defined by the command line and returns its exit status.
public java.lang.String getCommandline ()
  Returns the commandline used to create a subprocess.
public java.lang.String getEnvironment ()
  Returns the environment used to create a subprocess.
public int getExitValue ()
  Query the exit value of the process.
publicstaticsynchronized java.util.Vector getProcEnvironment ()
  Find the list of environment variables for this process.
public java.io.File getWorkingDirectory ()
  Return the working directory.
public boolean isFailure ()
  Did this execute return in a failure.
publicstatic boolean isFailure (int exitValue)
  Checks whether exitValue signals a failure on the current system (OS specific).
public boolean killedProcess ()
  Test for an untimely death of the process.
publicstatic java.lang.Process launch (Project project, java.lang.String command, java.lang.String env, java.io.File dir, boolean useVM) throws java.io.IOException
  Creates a process that runs a command.
publicstatic void runCommand (Task task, java.lang.String cmdline) throws BuildException
  A utility method that runs an external command.
public void setAntRun (Project project) throws BuildException
  Set the name of the antRun script using the project's value.
public void setCommandline (java.lang.String commandline)
  Sets the commandline of the subprocess to launch.
public void setEnvironment (java.lang.String env)
  Sets the environment variables for the subprocess to launch.
protected void setExitValue (int value)
  Set the exit value.
public void setNewenvironment (boolean newenv)
  Set whether to propagate the default environment or not.
public void setSpawn (boolean spawn)
  Set whether or not you want the process to be spawned.
public void setStreamHandler (ExecuteStreamHandler streamHandler)
  Set the stream handler to use.
public void setVMLauncher (boolean useVMLauncher)
  Launch this execution through the VM, where possible, rather than through the OS's shell.
public void setWorkingDirectory (java.io.File wd)
  Sets the working directory of the process to execute.
public void spawn () throws java.io.IOException
  Starts a process defined by the command line.
publicstatic java.lang.String toString (java.io.ByteArrayOutputStream bos)
  ByteArrayOutputStream#toString doesn't seem to work reliably on OS/390, at least not the way we use it in the execution context.
protected void waitFor (java.lang.Process process)
  Wait for a given process.
Fields
Hide/Show inherited fields
publicfinalstatic int INVALID = "2147483647"
  Invalid exit code.
Nested Classes
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar