1 | <html>
|
---|
2 |
|
---|
3 | <head>
|
---|
4 | <meta http-equiv="Content-Language" content="en-us">
|
---|
5 | <title>Redirector Type</title>
|
---|
6 | </head>
|
---|
7 |
|
---|
8 | <body>
|
---|
9 |
|
---|
10 | <h2><a name="redirector">I/O redirection</a></h2>
|
---|
11 | <p>For many tasks, input and output can be defined in a fairly
|
---|
12 | straightforward fashion. The <a href="../CoreTasks/exec.html">exec</a>
|
---|
13 | task, used to execute an external process, stands as a very
|
---|
14 | basic example. The executed process may accept input, produce
|
---|
15 | output, or do either or both depending upon various circumstances.
|
---|
16 | Output may be classified as "output" or as "error
|
---|
17 | output." The <code><redirector></code> type provides a concrete means
|
---|
18 | of redirecting input and output featuring the use of
|
---|
19 | <a href="./mapper.html">File Mapper</a>s to specify
|
---|
20 | source (input) and destination (output/error) files. <em>Since Ant 1.6.2</em>
|
---|
21 | <p>The <code><redirector></code> element accepts the following attributes:</p>
|
---|
22 | <table border="1" cellpadding="2" cellspacing="0">
|
---|
23 | <tr>
|
---|
24 | <td valign="top"><b>Attribute</b></td>
|
---|
25 | <td valign="top"><b>Description</b></td>
|
---|
26 | <td align="center" valign="top"><b>Required</b></td>
|
---|
27 | </tr>
|
---|
28 | <tr>
|
---|
29 | <td valign="top">output</td>
|
---|
30 | <td valign="top">Name of a file to which output should be written.
|
---|
31 | If the error stream is not also redirected to a file or property,
|
---|
32 | it will appear in this output.</td>
|
---|
33 | <td align="center" valign="top">No</td>
|
---|
34 | </tr>
|
---|
35 | <tr>
|
---|
36 | <td valign="top">error</td>
|
---|
37 | <td valign="top">The file to which the standard error of the
|
---|
38 | command should be redirected.</td>
|
---|
39 | <td align="center" valign="top">No</td>
|
---|
40 | </tr>
|
---|
41 | <tr>
|
---|
42 | <td valign="top">logError</td>
|
---|
43 | <td valign="top">This attribute is used when you wish to see
|
---|
44 | error output in Ant's log and you are redirecting output to
|
---|
45 | a file/property. The error output will not be included in
|
---|
46 | the output file/property. If you redirect error with the
|
---|
47 | <i>error</i> or <i>errorProperty</i> attributes, this will
|
---|
48 | have no effect.</td>
|
---|
49 | <td align="center" valign="top">No</td>
|
---|
50 | </tr>
|
---|
51 | <tr>
|
---|
52 | <td valign="top">append</td>
|
---|
53 | <td valign="top">Whether output and error files should be
|
---|
54 | appended to rather than overwritten. Defaults to
|
---|
55 | <code>false</code>.</td>
|
---|
56 | <td align="center" valign="top">No</td>
|
---|
57 | </tr>
|
---|
58 | <tr>
|
---|
59 | <td valign="top">createemptyfiles</td>
|
---|
60 | <td valign="top">Whether output and error files should be
|
---|
61 | created even when empty. Defaults to <code>true</code>.</td>
|
---|
62 | <td align="center" valign="top">No</td>
|
---|
63 | </tr>
|
---|
64 | <tr>
|
---|
65 | <td valign="top">outputproperty</td>
|
---|
66 | <td valign="top">The name of a property in which the output of the
|
---|
67 | command should be stored. Unless the error stream is redirected
|
---|
68 | to a separate file or stream, this property will include the
|
---|
69 | error output.</td>
|
---|
70 | <td align="center" valign="top">No</td>
|
---|
71 | </tr>
|
---|
72 | <tr>
|
---|
73 | <td valign="top">errorproperty</td>
|
---|
74 | <td valign="top">The name of a property in which the standard error
|
---|
75 | of the command should be stored.</td>
|
---|
76 | <td align="center" valign="top">No</td>
|
---|
77 | </tr>
|
---|
78 | <tr>
|
---|
79 | <td valign="top">input</td>
|
---|
80 | <td valign="top">A file from which the executed command's standard input
|
---|
81 | is taken. This attribute is mutually exclusive with the
|
---|
82 | <i>inputstring</i> attribute.</td>
|
---|
83 | <td align="center" valign="top">No</td>
|
---|
84 | </tr>
|
---|
85 | <tr>
|
---|
86 | <td valign="top">inputstring</td>
|
---|
87 | <td valign="top">A string which serves as the input stream for the
|
---|
88 | executed command. This attribute is mutually exclusive with the
|
---|
89 | <i>input</i> attribute.</td>
|
---|
90 | <td align="center" valign="top">No</td>
|
---|
91 | </tr>
|
---|
92 | <tr>
|
---|
93 | <td valign="top">inputencoding</td>
|
---|
94 | <td valign="top">The input encoding.</td>
|
---|
95 | <td align="center" valign="top">No</td>
|
---|
96 | </tr>
|
---|
97 | <tr>
|
---|
98 | <td valign="top">outputencoding</td>
|
---|
99 | <td valign="top">The output encoding.</td>
|
---|
100 | <td align="center" valign="top">No</td>
|
---|
101 | </tr>
|
---|
102 | <tr>
|
---|
103 | <td valign="top">errorencoding</td>
|
---|
104 | <td valign="top">The error encoding.</td>
|
---|
105 | <td align="center" valign="top">No</td>
|
---|
106 | </tr>
|
---|
107 | <tr>
|
---|
108 | <td valign="top">alwayslog</td>
|
---|
109 | <td valign="top">Always send to the log in addition to
|
---|
110 | any other destination. Default <code>false</code>.
|
---|
111 | <i>Since Ant 1.6.3</i>.
|
---|
112 | </td>
|
---|
113 | <td align="center" valign="top">No</td>
|
---|
114 | </tr>
|
---|
115 | </table>
|
---|
116 | <h3>Parameters specified as nested elements</h3>
|
---|
117 | <h4>inputmapper</h4>
|
---|
118 | <p>A single <a href="./mapper.html">File Mapper</a> used to redirect process
|
---|
119 | input. Multiple mapping results should concatenate all mapped files as input.
|
---|
120 | Mapping will ordinarily be performed on a task-specified sourcefile;
|
---|
121 | consult the documentation of the individual task for more details.
|
---|
122 | A nested <code><inputmapper></code> is not compatible with either of the
|
---|
123 | <i>input</i> or <i>inputstring</i> attributes.</p>
|
---|
124 | <h4>outputmapper</h4>
|
---|
125 | <p>A single <a href="./mapper.html">File Mapper</a> used to redirect process
|
---|
126 | output. Mapping will ordinarily be performed on a task-specified sourcefile;
|
---|
127 | consult the documentation of the individual task for more details.
|
---|
128 | A nested <code><outputmapper></code> is not compatible with the
|
---|
129 | <i>output</i> attribute.</p>
|
---|
130 | <h4>errormapper</h4>
|
---|
131 | <p>A single <a href="./mapper.html">File Mapper</a> used to redirect error
|
---|
132 | output. Mapping will ordinarily be performed on a task-specified sourcefile;
|
---|
133 | consult the documentation of the individual task for more details.
|
---|
134 | A nested <code><errormapper></code> is not compatible with the
|
---|
135 | <i>error</i> attribute.</p>
|
---|
136 | <h4>inputfilterchain</h4>
|
---|
137 | <p>A <a href="./filterchain.html">FilterChain</a> can be
|
---|
138 | applied to the process input.</p>
|
---|
139 | <h4>outputfilterchain</h4>
|
---|
140 | <p>A <a href="./filterchain.html">FilterChain</a> can be
|
---|
141 | applied to the process output.</p>
|
---|
142 | <h4>errorfilterchain</h4>
|
---|
143 | <p>A <a href="./filterchain.html">FilterChain</a> can be
|
---|
144 | applied to the error output.</p>
|
---|
145 | <h3>Usage</h3>
|
---|
146 | Tasks known to support I/O redirection:
|
---|
147 | <ul>
|
---|
148 | <li><a href="../CoreTasks/exec.html">Exec</a></li>
|
---|
149 | <li><a href="../CoreTasks/apply.html">Apply</a></li>
|
---|
150 | <li><a href="../CoreTasks/java.html">Java</a></li>
|
---|
151 | </ul>
|
---|
152 | <p>The expected behavior of a <code><redirector></code> is to a great degree
|
---|
153 | dependent on the supporting task. Any possible points of confusion
|
---|
154 | should be noted at the task level.</p>
|
---|
155 | <hr />
|
---|
156 | <p align="center">Copyright © 2004 The Apache Software Foundation. All rights
|
---|
157 | Reserved.</p>
|
---|
158 |
|
---|
159 | </body>
|
---|
160 | </html>
|
---|
161 |
|
---|