????
| Current Path : /opt/ant/manual/api/org/apache/tools/ant/taskdefs/ |
| Current File : //opt/ant/manual/api/org/apache/tools/ant/taskdefs/Execute.html |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_03) on Tue May 22 06:24:52 CEST 2012 -->
<title>Execute (Apache Ant API)</title>
<meta name="date" content="2012-05-22">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Execute (Apache Ant API)";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../org/apache/tools/ant/taskdefs/ExecTask.html" title="class in org.apache.tools.ant.taskdefs"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../../org/apache/tools/ant/taskdefs/ExecuteJava.html" title="class in org.apache.tools.ant.taskdefs"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/tools/ant/taskdefs/Execute.html" target="_top">Frames</a></li>
<li><a href="Execute.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li><a href="#field_summary">Field</a> | </li>
<li><a href="#constructor_summary">Constr</a> | </li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li><a href="#field_detail">Field</a> | </li>
<li><a href="#constructor_detail">Constr</a> | </li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">org.apache.tools.ant.taskdefs</div>
<h2 title="Class Execute" class="title">Class Execute</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>org.apache.tools.ant.taskdefs.Execute</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public class <span class="strong">Execute</span>
extends java.lang.Object</pre>
<div class="block">Runs an external program.</div>
<dl><dt><span class="strong">Since:</span></dt>
<dd>Ant 1.2</dd></dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field_summary">
<!-- -->
</a>
<h3>Field Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation">
<caption><span>Fields</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Field and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/tools/ant/taskdefs/Execute.html#INVALID">INVALID</a></strong></code>
<div class="block">Invalid exit code.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../../../org/apache/tools/ant/taskdefs/Execute.html#Execute()">Execute</a></strong>()</code>
<div class="block">Creates a new execute object using <code>PumpStreamHandler</code> for
stream handling.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><strong><a href="../../../../../org/apache/tools/ant/taskdefs/Execute.html#Execute(org.apache.tools.ant.taskdefs.ExecuteStreamHandler)">Execute</a></strong>(<a href="../../../../../org/apache/tools/ant/taskdefs/ExecuteStreamHandler.html" title="interface in org.apache.tools.ant.taskdefs">ExecuteStreamHandler</a> streamHandler)</code>
<div class="block">Creates a new execute object.</div>
</td>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../../../org/apache/tools/ant/taskdefs/Execute.html#Execute(org.apache.tools.ant.taskdefs.ExecuteStreamHandler, org.apache.tools.ant.taskdefs.ExecuteWatchdog)">Execute</a></strong>(<a href="../../../../../org/apache/tools/ant/taskdefs/ExecuteStreamHandler.html" title="interface in org.apache.tools.ant.taskdefs">ExecuteStreamHandler</a> streamHandler,
<a href="../../../../../org/apache/tools/ant/taskdefs/ExecuteWatchdog.html" title="class in org.apache.tools.ant.taskdefs">ExecuteWatchdog</a> watchdog)</code>
<div class="block">Creates a new execute object.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/tools/ant/taskdefs/Execute.html#closeStreams(java.lang.Process)">closeStreams</a></strong>(java.lang.Process process)</code>
<div class="block">Close the streams belonging to the given Process.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/tools/ant/taskdefs/Execute.html#execute()">execute</a></strong>()</code>
<div class="block">Runs a process defined by the command line and returns its exit status.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>java.lang.String[]</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/tools/ant/taskdefs/Execute.html#getCommandline()">getCommandline</a></strong>()</code>
<div class="block">Returns the commandline used to create a subprocess.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>java.lang.String[]</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/tools/ant/taskdefs/Execute.html#getEnvironment()">getEnvironment</a></strong>()</code>
<div class="block">Returns the environment used to create a subprocess.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static java.util.Map</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/tools/ant/taskdefs/Execute.html#getEnvironmentVariables()">getEnvironmentVariables</a></strong>()</code>
<div class="block">Find the list of environment variables for this process.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/tools/ant/taskdefs/Execute.html#getExitValue()">getExitValue</a></strong>()</code>
<div class="block">Query the exit value of the process.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static java.util.Vector</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/tools/ant/taskdefs/Execute.html#getProcEnvironment()">getProcEnvironment</a></strong>()</code>
<div class="block"><strong>Deprecated.</strong>
<div class="block"><i>use #getEnvironmentVariables instead</i></div>
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>java.io.File</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/tools/ant/taskdefs/Execute.html#getWorkingDirectory()">getWorkingDirectory</a></strong>()</code>
<div class="block">Return the working directory.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/tools/ant/taskdefs/Execute.html#isFailure()">isFailure</a></strong>()</code>
<div class="block">Did this execute return in a failure.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/tools/ant/taskdefs/Execute.html#isFailure(int)">isFailure</a></strong>(int exitValue)</code>
<div class="block">Checks whether <code>exitValue</code> signals a failure on the current
system (OS specific).</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/tools/ant/taskdefs/Execute.html#killedProcess()">killedProcess</a></strong>()</code>
<div class="block">Test for an untimely death of the process.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static java.lang.Process</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/tools/ant/taskdefs/Execute.html#launch(org.apache.tools.ant.Project, java.lang.String[], java.lang.String[], java.io.File, boolean)">launch</a></strong>(<a href="../../../../../org/apache/tools/ant/Project.html" title="class in org.apache.tools.ant">Project</a> project,
java.lang.String[] command,
java.lang.String[] env,
java.io.File dir,
boolean useVM)</code>
<div class="block">Creates a process that runs a command.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/tools/ant/taskdefs/Execute.html#runCommand(org.apache.tools.ant.Task, java.lang.String[])">runCommand</a></strong>(<a href="../../../../../org/apache/tools/ant/Task.html" title="class in org.apache.tools.ant">Task</a> task,
java.lang.String[] cmdline)</code>
<div class="block">A utility method that runs an external command.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/tools/ant/taskdefs/Execute.html#setAntRun(org.apache.tools.ant.Project)">setAntRun</a></strong>(<a href="../../../../../org/apache/tools/ant/Project.html" title="class in org.apache.tools.ant">Project</a> project)</code>
<div class="block">Set the name of the antRun script using the project's value.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/tools/ant/taskdefs/Execute.html#setCommandline(java.lang.String[])">setCommandline</a></strong>(java.lang.String[] commandline)</code>
<div class="block">Sets the commandline of the subprocess to launch.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/tools/ant/taskdefs/Execute.html#setEnvironment(java.lang.String[])">setEnvironment</a></strong>(java.lang.String[] env)</code>
<div class="block">Sets the environment variables for the subprocess to launch.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected void</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/tools/ant/taskdefs/Execute.html#setExitValue(int)">setExitValue</a></strong>(int value)</code>
<div class="block">Set the exit value.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/tools/ant/taskdefs/Execute.html#setNewenvironment(boolean)">setNewenvironment</a></strong>(boolean newenv)</code>
<div class="block">Set whether to propagate the default environment or not.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/tools/ant/taskdefs/Execute.html#setSpawn(boolean)">setSpawn</a></strong>(boolean spawn)</code>
<div class="block"><strong>Deprecated.</strong> </div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/tools/ant/taskdefs/Execute.html#setStreamHandler(org.apache.tools.ant.taskdefs.ExecuteStreamHandler)">setStreamHandler</a></strong>(<a href="../../../../../org/apache/tools/ant/taskdefs/ExecuteStreamHandler.html" title="interface in org.apache.tools.ant.taskdefs">ExecuteStreamHandler</a> streamHandler)</code>
<div class="block">Set the stream handler to use.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/tools/ant/taskdefs/Execute.html#setVMLauncher(boolean)">setVMLauncher</a></strong>(boolean useVMLauncher)</code>
<div class="block">Launch this execution through the VM, where possible, rather than through
the OS's shell.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/tools/ant/taskdefs/Execute.html#setWorkingDirectory(java.io.File)">setWorkingDirectory</a></strong>(java.io.File wd)</code>
<div class="block">Sets the working directory of the process to execute.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/tools/ant/taskdefs/Execute.html#spawn()">spawn</a></strong>()</code>
<div class="block">Starts a process defined by the command line.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static java.lang.String</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/tools/ant/taskdefs/Execute.html#toString(java.io.ByteArrayOutputStream)">toString</a></strong>(java.io.ByteArrayOutputStream bos)</code>
<div class="block">ByteArrayOutputStream#toString doesn't seem to work reliably on
OS/390, at least not the way we use it in the execution
context.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected void</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/tools/ant/taskdefs/Execute.html#waitFor(java.lang.Process)">waitFor</a></strong>(java.lang.Process process)</code>
<div class="block">Wait for a given process.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class java.lang.Object</h3>
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ FIELD DETAIL =========== -->
<ul class="blockList">
<li class="blockList"><a name="field_detail">
<!-- -->
</a>
<h3>Field Detail</h3>
<a name="INVALID">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>INVALID</h4>
<pre>public static final int INVALID</pre>
<div class="block">Invalid exit code.
set to <code>Integer.MAX_VALUE</code></div>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../constant-values.html#org.apache.tools.ant.taskdefs.Execute.INVALID">Constant Field Values</a></dd></dl>
</li>
</ul>
</li>
</ul>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="Execute()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>Execute</h4>
<pre>public Execute()</pre>
<div class="block">Creates a new execute object using <code>PumpStreamHandler</code> for
stream handling.</div>
</li>
</ul>
<a name="Execute(org.apache.tools.ant.taskdefs.ExecuteStreamHandler)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>Execute</h4>
<pre>public Execute(<a href="../../../../../org/apache/tools/ant/taskdefs/ExecuteStreamHandler.html" title="interface in org.apache.tools.ant.taskdefs">ExecuteStreamHandler</a> streamHandler)</pre>
<div class="block">Creates a new execute object.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>streamHandler</code> - the stream handler used to handle the input and
output streams of the subprocess.</dd></dl>
</li>
</ul>
<a name="Execute(org.apache.tools.ant.taskdefs.ExecuteStreamHandler, org.apache.tools.ant.taskdefs.ExecuteWatchdog)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>Execute</h4>
<pre>public Execute(<a href="../../../../../org/apache/tools/ant/taskdefs/ExecuteStreamHandler.html" title="interface in org.apache.tools.ant.taskdefs">ExecuteStreamHandler</a> streamHandler,
<a href="../../../../../org/apache/tools/ant/taskdefs/ExecuteWatchdog.html" title="class in org.apache.tools.ant.taskdefs">ExecuteWatchdog</a> watchdog)</pre>
<div class="block">Creates a new execute object.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>streamHandler</code> - the stream handler used to handle the input and
output streams of the subprocess.</dd><dd><code>watchdog</code> - a watchdog for the subprocess or <code>null</code> to
to disable a timeout for the subprocess.</dd></dl>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="setSpawn(boolean)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setSpawn</h4>
<pre>public void setSpawn(boolean spawn)</pre>
<div class="block"><span class="strong">Deprecated.</span> <i></i></div>
<div class="block">Set whether or not you want the process to be spawned.
Default is not spawned.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>spawn</code> - if true you do not want Ant
to wait for the end of the process.
Has no influence in here, the calling task contains
and acts accordingly</dd><dt><span class="strong">Since:</span></dt>
<dd>Ant 1.6</dd></dl>
</li>
</ul>
<a name="getEnvironmentVariables()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getEnvironmentVariables</h4>
<pre>public static java.util.Map getEnvironmentVariables()</pre>
<div class="block">Find the list of environment variables for this process.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>a map containing the environment variables.</dd><dt><span class="strong">Since:</span></dt>
<dd>Ant 1.8.2</dd></dl>
</li>
</ul>
<a name="getProcEnvironment()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getProcEnvironment</h4>
<pre>public static java.util.Vector getProcEnvironment()</pre>
<div class="block"><span class="strong">Deprecated.</span> <i>use #getEnvironmentVariables instead</i></div>
<div class="block">Find the list of environment variables for this process.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>a vector containing the environment variables.
The vector elements are strings formatted like variable = value.</dd></dl>
</li>
</ul>
<a name="toString(java.io.ByteArrayOutputStream)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>toString</h4>
<pre>public static java.lang.String toString(java.io.ByteArrayOutputStream bos)</pre>
<div class="block">ByteArrayOutputStream#toString doesn't seem to work reliably on
OS/390, at least not the way we use it in the execution
context.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>bos</code> - the output stream that one wants to read.</dd>
<dt><span class="strong">Returns:</span></dt><dd>the output stream as a string, read with
special encodings in the case of z/os and os/400.</dd><dt><span class="strong">Since:</span></dt>
<dd>Ant 1.5</dd></dl>
</li>
</ul>
<a name="setStreamHandler(org.apache.tools.ant.taskdefs.ExecuteStreamHandler)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setStreamHandler</h4>
<pre>public void setStreamHandler(<a href="../../../../../org/apache/tools/ant/taskdefs/ExecuteStreamHandler.html" title="interface in org.apache.tools.ant.taskdefs">ExecuteStreamHandler</a> streamHandler)</pre>
<div class="block">Set the stream handler to use.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>streamHandler</code> - ExecuteStreamHandler.</dd><dt><span class="strong">Since:</span></dt>
<dd>Ant 1.6</dd></dl>
</li>
</ul>
<a name="getCommandline()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getCommandline</h4>
<pre>public java.lang.String[] getCommandline()</pre>
<div class="block">Returns the commandline used to create a subprocess.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>the commandline used to create a subprocess.</dd></dl>
</li>
</ul>
<a name="setCommandline(java.lang.String[])">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setCommandline</h4>
<pre>public void setCommandline(java.lang.String[] commandline)</pre>
<div class="block">Sets the commandline of the subprocess to launch.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>commandline</code> - the commandline of the subprocess to launch.</dd></dl>
</li>
</ul>
<a name="setNewenvironment(boolean)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setNewenvironment</h4>
<pre>public void setNewenvironment(boolean newenv)</pre>
<div class="block">Set whether to propagate the default environment or not.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>newenv</code> - whether to propagate the process environment.</dd></dl>
</li>
</ul>
<a name="getEnvironment()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getEnvironment</h4>
<pre>public java.lang.String[] getEnvironment()</pre>
<div class="block">Returns the environment used to create a subprocess.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>the environment used to create a subprocess.</dd></dl>
</li>
</ul>
<a name="setEnvironment(java.lang.String[])">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setEnvironment</h4>
<pre>public void setEnvironment(java.lang.String[] env)</pre>
<div class="block">Sets the environment variables for the subprocess to launch.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>env</code> - array of Strings, each element of which has
an environment variable settings in format <em>key=value</em>.</dd></dl>
</li>
</ul>
<a name="setWorkingDirectory(java.io.File)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setWorkingDirectory</h4>
<pre>public void setWorkingDirectory(java.io.File wd)</pre>
<div class="block">Sets the working directory of the process to execute.
<p>This is emulated using the antRun scripts unless the OS is
Windows NT in which case a cmd.exe is spawned,
or MRJ and setting user.dir works, or JDK 1.3 and there is
official support in java.lang.Runtime.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>wd</code> - the working directory of the process.</dd></dl>
</li>
</ul>
<a name="getWorkingDirectory()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getWorkingDirectory</h4>
<pre>public java.io.File getWorkingDirectory()</pre>
<div class="block">Return the working directory.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>the directory as a File.</dd><dt><span class="strong">Since:</span></dt>
<dd>Ant 1.7</dd></dl>
</li>
</ul>
<a name="setAntRun(org.apache.tools.ant.Project)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setAntRun</h4>
<pre>public void setAntRun(<a href="../../../../../org/apache/tools/ant/Project.html" title="class in org.apache.tools.ant">Project</a> project)
throws <a href="../../../../../org/apache/tools/ant/BuildException.html" title="class in org.apache.tools.ant">BuildException</a></pre>
<div class="block">Set the name of the antRun script using the project's value.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>project</code> - the current project.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../../org/apache/tools/ant/BuildException.html" title="class in org.apache.tools.ant">BuildException</a></code> - not clear when it is going to throw an exception, but
it is the method's signature.</dd></dl>
</li>
</ul>
<a name="setVMLauncher(boolean)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setVMLauncher</h4>
<pre>public void setVMLauncher(boolean useVMLauncher)</pre>
<div class="block">Launch this execution through the VM, where possible, rather than through
the OS's shell. In some cases and operating systems using the shell will
allow the shell to perform additional processing such as associating an
executable with a script, etc.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>useVMLauncher</code> - true if exec should launch through the VM,
false if the shell should be used to launch the
command.</dd></dl>
</li>
</ul>
<a name="launch(org.apache.tools.ant.Project, java.lang.String[], java.lang.String[], java.io.File, boolean)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>launch</h4>
<pre>public static java.lang.Process launch(<a href="../../../../../org/apache/tools/ant/Project.html" title="class in org.apache.tools.ant">Project</a> project,
java.lang.String[] command,
java.lang.String[] env,
java.io.File dir,
boolean useVM)
throws java.io.IOException</pre>
<div class="block">Creates a process that runs a command.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>project</code> - the Project, only used for logging purposes, may be null.</dd><dd><code>command</code> - the command to run.</dd><dd><code>env</code> - the environment for the command.</dd><dd><code>dir</code> - the working directory for the command.</dd><dd><code>useVM</code> - use the built-in exec command for JDK 1.3 if available.</dd>
<dt><span class="strong">Returns:</span></dt><dd>the process started.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code>java.io.IOException</code> - forwarded from the particular launcher used.</dd><dt><span class="strong">Since:</span></dt>
<dd>Ant 1.5</dd></dl>
</li>
</ul>
<a name="execute()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>execute</h4>
<pre>public int execute()
throws java.io.IOException</pre>
<div class="block">Runs a process defined by the command line and returns its exit status.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>the exit status of the subprocess or <code>INVALID</code>.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code>java.io.IOException</code> - The exception is thrown, if launching
of the subprocess failed.</dd></dl>
</li>
</ul>
<a name="spawn()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>spawn</h4>
<pre>public void spawn()
throws java.io.IOException</pre>
<div class="block">Starts a process defined by the command line.
Ant will not wait for this process, nor log its output.</div>
<dl><dt><span class="strong">Throws:</span></dt>
<dd><code>java.io.IOException</code> - The exception is thrown, if launching
of the subprocess failed.</dd><dt><span class="strong">Since:</span></dt>
<dd>Ant 1.6</dd></dl>
</li>
</ul>
<a name="waitFor(java.lang.Process)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>waitFor</h4>
<pre>protected void waitFor(java.lang.Process process)</pre>
<div class="block">Wait for a given process.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>process</code> - the process one wants to wait for.</dd></dl>
</li>
</ul>
<a name="setExitValue(int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setExitValue</h4>
<pre>protected void setExitValue(int value)</pre>
<div class="block">Set the exit value.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>value</code> - exit value of the process.</dd></dl>
</li>
</ul>
<a name="getExitValue()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getExitValue</h4>
<pre>public int getExitValue()</pre>
<div class="block">Query the exit value of the process.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>the exit value or Execute.INVALID if no exit value has
been received.</dd></dl>
</li>
</ul>
<a name="isFailure(int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isFailure</h4>
<pre>public static boolean isFailure(int exitValue)</pre>
<div class="block">Checks whether <code>exitValue</code> signals a failure on the current
system (OS specific).
<p><b>Note</b> that this method relies on the conventions of
the OS, it will return false results if the application you are
running doesn't follow these conventions. One notable
exception is the Java VM provided by HP for OpenVMS - it will
return 0 if successful (like on any other platform), but this
signals a failure on OpenVMS. So if you execute a new Java VM
on OpenVMS, you cannot trust this method.</p></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>exitValue</code> - the exit value (return code) to be checked.</dd>
<dt><span class="strong">Returns:</span></dt><dd><code>true</code> if <code>exitValue</code> signals a failure.</dd></dl>
</li>
</ul>
<a name="isFailure()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isFailure</h4>
<pre>public boolean isFailure()</pre>
<div class="block">Did this execute return in a failure.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>true if and only if the exit code is interpreted as a failure</dd><dt><span class="strong">Since:</span></dt>
<dd>Ant1.7</dd>
<dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../org/apache/tools/ant/taskdefs/Execute.html#isFailure(int)"><code>isFailure(int)</code></a></dd></dl>
</li>
</ul>
<a name="killedProcess()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>killedProcess</h4>
<pre>public boolean killedProcess()</pre>
<div class="block">Test for an untimely death of the process.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>true if a watchdog had to kill the process.</dd><dt><span class="strong">Since:</span></dt>
<dd>Ant 1.5</dd></dl>
</li>
</ul>
<a name="runCommand(org.apache.tools.ant.Task, java.lang.String[])">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>runCommand</h4>
<pre>public static void runCommand(<a href="../../../../../org/apache/tools/ant/Task.html" title="class in org.apache.tools.ant">Task</a> task,
java.lang.String[] cmdline)
throws <a href="../../../../../org/apache/tools/ant/BuildException.html" title="class in org.apache.tools.ant">BuildException</a></pre>
<div class="block">A utility method that runs an external command. Writes the output and
error streams of the command to the project log.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>task</code> - The task that the command is part of. Used for logging</dd><dd><code>cmdline</code> - The command to execute.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../../org/apache/tools/ant/BuildException.html" title="class in org.apache.tools.ant">BuildException</a></code> - if the command does not exit successfully.</dd></dl>
</li>
</ul>
<a name="closeStreams(java.lang.Process)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>closeStreams</h4>
<pre>public static void closeStreams(java.lang.Process process)</pre>
<div class="block">Close the streams belonging to the given Process.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>process</code> - the <code>Process</code>.</dd></dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../org/apache/tools/ant/taskdefs/ExecTask.html" title="class in org.apache.tools.ant.taskdefs"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../../org/apache/tools/ant/taskdefs/ExecuteJava.html" title="class in org.apache.tools.ant.taskdefs"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/tools/ant/taskdefs/Execute.html" target="_top">Frames</a></li>
<li><a href="Execute.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li><a href="#field_summary">Field</a> | </li>
<li><a href="#constructor_summary">Constr</a> | </li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li><a href="#field_detail">Field</a> | </li>
<li><a href="#constructor_detail">Constr</a> | </li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>