--- ftp.html.orig Wed Sep 18 08:16:02 2002 +++ ftp.html Wed Sep 18 12:56:12 2002 @@ -66,7 +66,8 @@ action the ftp action to perform, defaulting to "send". Currently supports "put", "get", - "del", "list", "chmod" and "mkdir". + "del", "list", "chmod", + "mkdir" and "rmdir". No @@ -262,6 +263,55 @@

This creates the directory some/remote/dir beneath the default root directory. As with all other actions, the directory separator character must be correct according to the desires of the FTP server.

+

Removing Directories

+This action uses nested fileset elements to +select the directories to remove from the remote FTP server. The +filesets are relative to the remote directory, not a local directory. +The dir attribute of the fileset is ignored completely. +The directories to be removed must be empty, or contain only +other directories that have been also selected to be removed by the filesets +patterns, otherwise a BuildException will be thrown. +Also, if you don't have permission to remove a directory, a BuildException is +thrown. + +
+  <ftp action="rmdir"
+       server="ftp.apache.org"
+       userid="anonymous"
+       password="me@myorg.com" 
+       remotedir="/somedir" >
+    <fileset>
+      <include name="dira"/>
+      <include name="dirb/**"/>
+    </fileset>
+  </ftp>
+
+

Logs in to ftp.apache.org as anonymous and +tries to remove /somedir/dira directory and +all the directories tree starting at, and including, /somedir/dirb. +When removing the /somedir/dirb tree, +it will start at the leaves moving up to the root, so that when +it tries to remove a directory it is sure all the directories under it are +already removed. +Obviuosly all the files in the tree must have been already deleted. +

+

As an example suppose you want to delete everything contained into +/somedir, so invoke first the <ftp> task with +action="delete", then with +action="rmdir" specifying in both cases +remotedir="/somedir" and + +

+    <fileset>
+        <include name="**"/>
+    </fileset>
+
+ +The directory specified in the remotedir parameter is never +selected for remove, so if you need to remove it, specify its parent in +remotedir parameter and include it in the +<fileset> pattern, like "somedir/**". +


Copyright © 2000-2002 Apache Software Foundation. All rights Reserved.