View | Details | Raw Unified | Return to bug 12765
Collapse All | Expand All

(-)ftp.html.orig (-1 / +51 lines)
Lines 66-72 Link Here
66
    <td valign="top">action</td>
66
    <td valign="top">action</td>
67
    <td valign="top">the ftp action to perform, defaulting to &quot;send&quot;.  
67
    <td valign="top">the ftp action to perform, defaulting to &quot;send&quot;.  
68
                     Currently supports &quot;put&quot;, &quot;get&quot;,
68
                     Currently supports &quot;put&quot;, &quot;get&quot;,
69
                     &quot;del&quot;, &quot;list&quot;, &quot;chmod&quot; and &quot;mkdir&quot;.</td>
69
                     &quot;del&quot;, &quot;list&quot;, &quot;chmod&quot;,
70
                     &quot;mkdir&quot; and &quot;rmdir&quot;.</td>
70
    <td valign="top" align="center">No</td>
71
    <td valign="top" align="center">No</td>
71
  </tr>
72
  </tr>
72
  <tr>
73
  <tr>
Lines 262-267 Link Here
262
<p>This creates the directory <code>some/remote/dir</code> beneath the default root
263
<p>This creates the directory <code>some/remote/dir</code> beneath the default root
263
directory.  As with all other actions, the directory separator character must be correct
264
directory.  As with all other actions, the directory separator character must be correct
264
according to the desires of the FTP server.</p>
265
according to the desires of the FTP server.</p>
266
<h3>Removing Directories</h3>
267
This action uses nested fileset elements to 
268
select the directories to remove from the remote FTP server.  The 
269
filesets are relative to the remote directory, not a local directory. 
270
The dir attribute of the fileset is ignored completely.
271
The directories to be removed must be empty, or contain only
272
other directories that have been also selected to be removed by the filesets
273
patterns, otherwise a BuildException will be thrown.
274
Also, if you don't have permission to remove a directory, a BuildException is 
275
thrown.
276
277
<pre>
278
  &lt;ftp action=&quot;rmdir&quot;
279
       server=&quot;ftp.apache.org&quot;
280
       userid=&quot;anonymous&quot;
281
       password=&quot;me@myorg.com&quot; 
282
       remotedir=&quot;/somedir&quot; &gt;
283
    &lt;fileset&gt;
284
      &lt;include name=&quot;dira&quot;/&gt;
285
      &lt;include name=&quot;dirb/**&quot;/&gt;
286
    &lt;/fileset&gt;
287
  &lt;/ftp&gt;
288
</pre>
289
<p>Logs in to <code>ftp.apache.org</code> as <code>anonymous</code> and
290
tries to remove <code>/somedir/dira</code> directory and
291
all the directories tree starting at, and including, <code>/somedir/dirb</code>.
292
When removing the <code>/somedir/dirb</code> tree,
293
it will start at the leaves moving up to the root, so that when
294
it tries to remove a directory it is sure all the directories under it are
295
already removed.
296
Obviuosly all the files in the tree must have been already deleted.
297
</p>
298
<p>As an example suppose you want to delete everything contained into 
299
<code>/somedir</code>, so invoke first the <code>&lt;ftp&gt;</code> task with
300
<code>action=&quot;delete&quot;</code>, then with 
301
<code>action=&quot;rmdir&quot;</code> specifying in both cases
302
<code>remotedir=&quot;/somedir&quot;</code> and
303
304
<pre>
305
    &lt;fileset&gt;
306
        &lt;include name=&quot;**&quot;/&gt;
307
    &lt;/fileset&gt;
308
</pre>
309
310
The directory specified in the <code>remotedir</code> parameter is never
311
selected for remove, so if you need to remove it, specify its parent in
312
<code>remotedir</code> parameter and include it in the 
313
<code>&lt;fileset&gt;</code> pattern, like <code>&quot;somedir/**&quot;</code>.
314
</p>
265
<hr>
315
<hr>
266
<p align="center">Copyright &copy; 2000-2002 Apache Software Foundation. All rights
316
<p align="center">Copyright &copy; 2000-2002 Apache Software Foundation. All rights
267
Reserved.</p>
317
Reserved.</p>

Return to bug 12765