1 | <!--
|
---|
2 | Licensed to the Apache Software Foundation (ASF) under one or more
|
---|
3 | contributor license agreements. See the NOTICE file distributed with
|
---|
4 | this work for additional information regarding copyright ownership.
|
---|
5 | The ASF licenses this file to You under the Apache License, Version 2.0
|
---|
6 | (the "License"); you may not use this file except in compliance with
|
---|
7 | the License. You may obtain a copy of the License at
|
---|
8 |
|
---|
9 | http://www.apache.org/licenses/LICENSE-2.0
|
---|
10 |
|
---|
11 | Unless required by applicable law or agreed to in writing, software
|
---|
12 | distributed under the License is distributed on an "AS IS" BASIS,
|
---|
13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
---|
14 | See the License for the specific language governing permissions and
|
---|
15 | limitations under the License.
|
---|
16 | -->
|
---|
17 |
|
---|
18 | <html>
|
---|
19 | <head>
|
---|
20 | <meta http-equiv="Content-Language" content="en-us">
|
---|
21 | <title>Tempfile
|
---|
22 | Task</title>
|
---|
23 | <link rel="stylesheet" type="text/css" href="../stylesheets/style.css">
|
---|
24 | </head>
|
---|
25 |
|
---|
26 | <body>
|
---|
27 |
|
---|
28 |
|
---|
29 | <h2><a name="tempfile">Tempfile Task</a></h2>
|
---|
30 | <br>This task sets a property to the name of a temporary file.
|
---|
31 |
|
---|
32 |
|
---|
33 | <h3><a name="description">Description</a></h3>
|
---|
34 |
|
---|
35 | <p>
|
---|
36 | This task sets a property to the name of a temporary file.
|
---|
37 | Unlike <code>java.io.File.createTempFile</code>,
|
---|
38 | this task does not actually create the temporary file, but it does guarantee that the
|
---|
39 | file did not exist when the task was executed.
|
---|
40 |
|
---|
41 | <p>Examples:
|
---|
42 |
|
---|
43 | <pre><tempfile property="temp.file"/></pre>
|
---|
44 |
|
---|
45 | create a temporary file
|
---|
46 |
|
---|
47 | <pre><tempfile property="temp.file" suffix=".xml"/></pre>
|
---|
48 |
|
---|
49 | create a temporary file with the <code>.xml</code> suffix
|
---|
50 |
|
---|
51 | <pre><tempfile property="temp.file" destDir="build"/></pre>
|
---|
52 |
|
---|
53 | create a temporary file in the <code>build</code> subdirectory
|
---|
54 |
|
---|
55 | </blockquote>
|
---|
56 | </p>
|
---|
57 | <!-- End Description -->
|
---|
58 |
|
---|
59 | <!-- Ignore -->
|
---|
60 |
|
---|
61 |
|
---|
62 |
|
---|
63 |
|
---|
64 |
|
---|
65 |
|
---|
66 |
|
---|
67 | <h3><a name="attributes">Parameters</a></h3>
|
---|
68 |
|
---|
69 | <table border="1" cellpadding="2" cellspacing="0">
|
---|
70 | <tr>
|
---|
71 | <td>
|
---|
72 | <b>Attribute</b>
|
---|
73 | </td>
|
---|
74 | <td>
|
---|
75 | <b>Description</b>
|
---|
76 | </td>
|
---|
77 | <td>
|
---|
78 | <b>Type</b>
|
---|
79 | </td>
|
---|
80 | <td>
|
---|
81 | <b>Requirement</b>
|
---|
82 | </td>
|
---|
83 | </tr>
|
---|
84 | <!-- Attribute Group -->
|
---|
85 | <!-- Attribute -->
|
---|
86 | <tr>
|
---|
87 | <td>
|
---|
88 | property
|
---|
89 | </td>
|
---|
90 | <td>
|
---|
91 | Sets the property you wish to assign the temporary file to.
|
---|
92 | </td>
|
---|
93 | <td>
|
---|
94 | String
|
---|
95 | </td>
|
---|
96 | <td>
|
---|
97 | Required
|
---|
98 | </td>
|
---|
99 | </tr>
|
---|
100 |
|
---|
101 | <!-- Attribute Group -->
|
---|
102 | <!-- Attribute -->
|
---|
103 | <tr>
|
---|
104 | <td>
|
---|
105 | destdir
|
---|
106 | </td>
|
---|
107 | <td>
|
---|
108 | Sets the destination directory. If not set, the basedir directory is used instead.
|
---|
109 | </td>
|
---|
110 | <td>
|
---|
111 | File
|
---|
112 | </td>
|
---|
113 | <td>
|
---|
114 | Optional
|
---|
115 | </td>
|
---|
116 | </tr>
|
---|
117 | <!-- Attribute -->
|
---|
118 | <tr>
|
---|
119 | <td>
|
---|
120 | prefix
|
---|
121 | </td>
|
---|
122 | <td>
|
---|
123 | Sets the optional prefix string for the temp file.
|
---|
124 | </td>
|
---|
125 | <td>
|
---|
126 | String
|
---|
127 | </td>
|
---|
128 | </tr>
|
---|
129 | <!-- Attribute -->
|
---|
130 | <tr>
|
---|
131 | <td>
|
---|
132 | suffix
|
---|
133 | </td>
|
---|
134 | <td>
|
---|
135 | Sets the optional suffix string for the temp file.
|
---|
136 | </td>
|
---|
137 | <td>
|
---|
138 | String
|
---|
139 | </td>
|
---|
140 | </tr>
|
---|
141 | <!-- Attribute -->
|
---|
142 | <tr>
|
---|
143 | <td>
|
---|
144 | deleteonexit
|
---|
145 | </td>
|
---|
146 | <td>
|
---|
147 | Whether the temp file will be marked for deletion on normal exit of the Java Virtual Machine (even though the file may never be created); default <em>false</em>. <strong>Since Ant 1.7</strong>
|
---|
148 | </td>
|
---|
149 | <td>
|
---|
150 | String
|
---|
151 | </td>
|
---|
152 | </tr>
|
---|
153 |
|
---|
154 |
|
---|
155 | </table>
|
---|
156 | </blockquote>
|
---|
157 | <!-- End Attributes -->
|
---|
158 |
|
---|
159 | <!-- Start Elements -->
|
---|
160 |
|
---|
161 | <h3><a name="elements">Parameters as nested elements</a></h3>
|
---|
162 |
|
---|
163 | </body>
|
---|
164 | </html>
|
---|