[go: up one dir, main page]

File: anttasks.xml

package info (click to toggle)
commons-vfs 1.0-5
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 2,452 kB
  • ctags: 3,357
  • sloc: java: 24,129; xml: 2,785; makefile: 15
file content (292 lines) | stat: -rw-r--r-- 10,599 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
<!--
    Licensed to the Apache Software Foundation (ASF) under one or more
    contributor license agreements.  See the NOTICE file distributed with
    this work for additional information regarding copyright ownership.
    The ASF licenses this file to You under the Apache License, Version 2.0
    (the "License"); you may not use this file except in compliance with
    the License.  You may obtain a copy of the License at
   
         http://www.apache.org/licenses/LICENSE-2.0
   
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
-->
<document>
    <properties>
        <title>Ant Tasks</title>
        <author email="adammurdoch@apache.org">Adam Murdoch</author>
    </properties>

    <body>
        <section name="Ant Tasks">
            <p>
                Commons VFS includes several Ant tasks that can be used
                to create, delete, copy and move files of any supported type.
                The tasks are:
            </p>
            <ul>
                <li>
                    <a href="#V-Copy">
                        <code>&lt;v-copy&gt;</code>
                    </a>
                    .
                    Copies a set of source folders and files to a destination
                    folder.
                </li>
                <li>
                    <a href="#V-Delete">
                        <code>&lt;v-delete&gt;</code>
                    </a>
                    .
                    Deletes a file or folder.
                </li>
                <li>
                    <a href="#V-Mkdir">
                        <code>&lt;v-mkdir&gt;</code>
                    </a>
                    .
                    Creates a folder.
                </li>
                <li>
                    <a href="#V-Move">
                        <code>&lt;v-move&gt;</code>
                    </a>
                    .
                    Moves a set of source folders and files to a destination
                    folder.
                </li>
                <li>
                    <a href="#V-Sync">
                        <code>&lt;v-sync&gt;</code>
                    </a>
                    .
                    Synchronises a destination folder with a set of source
                    folder and files.
                </li>
            </ul>
            <p>
                All file name attributes support relative and absolute local
                file names, and
                <a href="filesystems.html">absolute URI</a>
                .
                File names are interpreted relative to the Ant project's base
                directory.
            </p>

            <subsection name="Using the Tasks">
                <p>
                    To use the Ant tasks, copy commons-vfs.jar and its
                    dependencies into the
                    <code>$ANT_HOME/lib</code>
                    directory,
                    and use the following in your Ant scipt to define the tasks:
                </p>

                <source><![CDATA[
<taskdef resource="org/apache/commons/vfs/tasks/tasks.properties"/>
                    ]]></source>

                <p>
                    Alternatively, you can provide an explicit classpath when
                    you define the tasks:
                </p>

                <source><![CDATA[
<taskdef resource="org/apache/commons/vfs/tasks/tasks.properties">
    <classpath> ... </classpath>
</taskdef>
                    ]]></source>

                <p>
                    You can also use antlib:
                    <br/>
                    <b>Notice: VFS tasks registered that way do not have te "v-" prefix.</b>
                    If you migrate to antlib simply replace "v-" by e.g. "vfs:" or whatever
                    namespace you use.
                </p>

                <source><![CDATA[
<project ... xmlns:vfs="antlib:org.apache.commons.vfs.tasks">
    <target name="dosomething">
	    <vfs:copy .../>
    </target>
</project>
                    ]]></source>

            </subsection>
        </section>

        <section name="V-Copy">
            <p>Copies a set of files to a destination folder. Does not copy
                source files where the destination file exists and is newer than
                the source file. The copy task takes the following attributes:</p>

            <table>
                <tr>
                    <th>Name</th>
                    <th>Description</th>
                    <th>Required</th>
                </tr>
                <tr>
                    <td>destdir</td>
                    <td>The destination folder. This folder is created if it
                        does not exist.</td>
                    <td rowspan="2">One only</td>
                </tr>
                <tr>
                    <td>destfile</td>
                    <td>The destination file. Can only be used if there is a
                        single source file.</td>
                </tr>
                <tr>
                    <td>srcdir</td>
                    <td>The source folder. If used the includes and desdir
                        attributes should be specified.</td>
                    <td>No</td>
                </tr>
                <tr>
                    <td>includes</td>
                    <td>A comma or space separated list of files. The files
                        are resolved in combination with the specified
                        srcdir attribute.</td>
                    <td>Only if srcdir is specified.</td>
                </tr>
                <tr>
                    <td>overwrite</td>
                    <td>Always copy files, ignoring the last-modified time of
                        the destination file.</td>
                    <td>No, default is
                        <code>false</code>
                        .
                    </td>
                </tr>
                <tr>
                    <td>preservelastmodified</td>
                    <td>Set the last-modified time of destination files to
                        the same value as the source files. May not be supported
                        by the destination file system.</td>
                    <td>No, default is
                        <code>true</code>
                        .
                    </td>
                </tr>
                <tr>
                    <td>srcdirisbase</td>
                    <td>Set whether the source directory should be used as base directory.
                        If set to true, the subdirectories of the specified directories will be copied as well.</td>
                    <td>No, default is
                        <code>false</code>
                        .
                    </td>
                </tr>
                <tr>
                    <td>src</td>
                    <td>A source file or folder to copy. Copies all descendents
                        of a folder.</td>
                    <td>No</td>
                </tr>
            </table>

            <subsection name="Nested Elements">
                <p>
                    <b>
                        <code>&lt;src&gt;</code>
                    </b>
                </p>

                <p>Defines a source file or folder to copy. It takes the
                    following attributes:</p>

                <table>
                    <tr>
                        <th>Name</th>
                        <th>Description</th>
                        <th>Required</th>
                    </tr>
                    <tr>
                        <td>file</td>
                        <td>The source file.</td>
                        <td>Yes</td>
                    </tr>
                </table>
            </subsection>

        </section>

        <section name="V-Move">
            <p>Moves a set of files to a destination folder. Has the same
                attributes and elements as the copy task and following attributes:</p>
            <table>
                <tr>
                    <th>Name</th>
                    <th>Description</th>
                    <th>Required</th>
                </tr>
                <tr>
                    <td>tryRename</td>
                    <td>The destination folder. This folder is created if it
                        does not exist.</td>
                    <td>No, default is
                        <code>false</code>
                    </td>
                </tr>
            </table>
        </section>

        <section name="V-Sync">
            <p>Synchronises a destination folder with a set of source files.
                Has the same attributes and elements as the copy task.</p>
        </section>

        <section name="V-Delete">
            <p>Deletes a file or folder. It takes the following attributes:</p>

            <table>
                <tr>
                    <th>Name</th>
                    <th>Description</th>
                    <th>Required</th>
                </tr>
                <tr>
                    <td>file</td>
                    <td>The file or folder to delete. All descendents of
                        the folder are deleted.</td>
                    <td rowspan="2">One only</td>
                </tr>
                <tr>
                    <td>srcdir</td>
                    <td>The source folder. If used the includes attribute
                        should be specified.</td>
                </tr>
                <tr>
                    <td>includes</td>
                    <td>A comma or space separated list of files. The files
                        are resolved in combination with the specified
                        srcdir attribute.</td>
                    <td>Only if srcdir is specified.</td>
                </tr>
            </table>
        </section>

        <section name="V-Mkdir">
            <p>Creates a folder. It takes the following attributes:</p>

            <table>
                <tr>
                    <th>Name</th>
                    <th>Description</th>
                    <th>Required</th>
                </tr>
                <tr>
                    <td>dir</td>
                    <td>The folder create.</td>
                    <td>Yes</td>
                </tr>
            </table>

        </section>
    </body>
</document>