This is an automated email from the ASF dual-hosted git repository. jaikiran pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/ant.git
commit aa61cbce54378b25102fa41a62d7c3dead1df8cd Merge: 9e1bd14 f9b44f6 Author: Jaikiran Pai <[email protected]> AuthorDate: Wed Mar 6 16:53:17 2019 +0530 Merge 1.9.x branch into master WHATSNEW | 4 ++++ manual/Tasks/ftp.html | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --cc WHATSNEW index 166dcd4,68a6a5b..c5d7f58 --- a/WHATSNEW +++ b/WHATSNEW @@@ -101,12 -50,12 +101,16 @@@ Other changes the library behind the sshexec and scp Ant tasks. Github Pull Request #84 + * The "http" condition, now has a "readTimeout" attribute which can be + used to control the amount of time to wait for the read to complete. + Bugzilla Report 63193 + + * ftp task manual has been updated to mention that the remote listing of + files honours the followsymlinks attribute. + Bugzilla Report 63226 + -Changes from Ant 1.9.12 TO Ant 1.9.13 +Changes from Ant 1.10.4 TO Ant 1.10.5 ===================================== Fixed bugs: diff --cc manual/Tasks/ftp.html index e587d48,05cb3e3..07e4942 --- a/manual/Tasks/ftp.html +++ b/manual/Tasks/ftp.html @@@ -245,365 -333,391 +245,365 @@@ connection.</p </td> </tr> <tr> - <td valign="top">recentDateFormatConfig</td> - <td valign="top">Specify in Java - <a href="http://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html"> - SimpleDateFormat</a> notation, - (e.g. <code>MMM dd hh:mm</code>) the date format used by the FTP server - to parse dates less than a year old. If not specified (or specified as - <code>""</code>), and if the system type indicated by the system key uses - a recent date format, its standard format will be used.<br> - Since ant 1.7 + <td>systemTypeKey</td> + <td>Specifies the type of system in use on the server. Supported values + are <q>UNIX</q>, <q>VMS</q>, <q>WINDOWS</q>, <q>OS/2</q>, <q>OS/400</q>, <q>MVS</q>. If not + specified, (or specified as <q></q>) and if no other <var>xxxConfig</var> attributes are + specified, the autodetection mechanism based on the FTP <code>SYST</code> command will be + used.<br/><em>Since Ant 1.7</em></td> + <td>No, but if any of the following <var>xxxConfig</var> attributes is specified, UNIX will be + assumed, even if <q></q> is specified here. </td> - <td valign="top" align="center">No</td> - </tr> - <tr> - <td valign="top">serverLanguageCodeConfig</td> - <td valign="top">a <a href="http://www.ics.uci.edu/pub/ietf/http/related/iso639.txt"> - two-letter ISO-639 language code</a> used to specify the - language used by the server to format month names. This only needs to be - specified when the server uses non-numeric abbreviations for months in its - date listings in a language other than English. This appears to be - becoming rarer and rarer, as commonly distributed ftp servers seem - increasingly to use English or all-numeric formats. - Languages supported are: + </tr> + <tr> + <td>serverTimeZoneConfig</td> + <td>Specify as a + Java <a href="https://docs.oracle.com/javase/8/docs/api/java/util/TimeZone.html" + target="_top">TimeZone</a> identifier, (e.g. <q>GMT</q>, <q>America/Chicago</q> + or <q>Asia/Jakarta</q>) the timezone used by the server for timestamps. This enables + timestamp dependency checking even when the server is in a different time zone from the + client. Time Zones know, also, about daylight savings time, and do not require you to + calculate milliseconds of difference. If not specified, (or specified as <q></q>), the time + zone of the client is assumed.<br/><em>Since Ant 1.7</em></td> + <td>No</td> + </tr> + <tr> + <td>defaultDateFormatConfig</td> + <td>Specify in + Java <a href="https://docs.oracle.com/javase/8/docs/api/java/text/SimpleDateFormat.html" + target="_top">SimpleDateFormat</a> notation, (e.g. <q>yyyy-MM-dd</q>), the date format + generally used by the FTP server to parse dates. In some cases this will be the only date + format used. In others, (<q>unix</q> for example) this will be used for dates older than a + year old. (See <var>recentDateFormatConfig</var>). When specified as <q></q>, default value + will be used.<br/><em>Since Ant 1.7</em></td> + <td>No; defaults to default date format for the system type indicated + by <var>systemTypeKey</var></td> + </tr> + <tr> + <td>recentDateFormatConfig</td> + <td>Specify in + Java <a href="https://docs.oracle.com/javase/8/docs/api/java/text/SimpleDateFormat.html" + target="_top">SimpleDateFormat</a> notation, (e.g. <q>MMM dd hh:mm</q>) the date format used + by the FTP server to parse dates less than a year old. If not specified (or specified + as <q></q>), and if the system type indicated by the <var>systemTypeKey</var> uses a recent + date format, its standard format will be used.<br/><em>Since Ant 1.7</em></td> + <td>No</td> + </tr> + <tr> + <td>serverLanguageCodeConfig</td> + <td>a <a href="http://www.mathguide.de/info/tools/languagecode.html" target="_top">two-letter + ISO-639 language code</a> used to specify the language used by the server to format month + names. This only needs to be specified when the server uses non-numeric abbreviations for + months in its date listings in a language other than English. This appears to be becoming + rarer and rarer, as commonly distributed FTP servers seem increasingly to use English or + all-numeric formats. Languages supported are: <ul> - <li>en - English</li> - <li>fr - French</li> - <li>de - German</li> - <li>it - Italian</li> - <li>es - Spanish</li> - <li>pt - Portuguese</li> - <li>da - Danish</li> - <li>sv - Swedish</li> - <li>no - Norwegian</li> - <li>nl - Dutch</li> - <li>ro - Romanian</li> - <li>sq - Albanian</li> - <li>sh - Serbo-croatian</li> - <li>sk - Slovak</li> - <li>sl - Slovenian</li> + <li><q>en</q>—English</li> + <li><q>fr</q>—French</li> + <li><q>de</q>—German</li> + <li><q>it</q>—Italian</li> + <li><q>es</q>—Spanish</li> + <li><q>pt</q>—Portuguese</li> + <li><q>da</q>—Danish</li> + <li><q>sv</q>—Swedish</li> + <li><q>no</q>—Norwegian</li> + <li><q>nl</q>—Dutch</li> + <li><q>ro</q>—Romanian</li> + <li><q>sq</q>—Albanian</li> + <li><q>sh</q>—Serbo-Croatian</li> + <li><q>sk</q>—Slovak</li> + <li><q>sl</q>—Slovenian</li> </ul> - If you require a language other than the above, see also the - <b>shortMonthNamesConfig</b> attribute.<br> - Since ant 1.7 - </td> - - <td valign="top" align="center">No</td> + If you require a language other than the above, see also the <var>shortMonthNamesConfig</var> + attribute.<br/><em>Since Ant 1.7</em></td> + <td>No</td> </tr> <tr> - <td valign="top">shortMonthNamesConfig</td> - <td valign="top">specify the month abbreviations used on the server in file - timestamp dates as a pipe-delimited string for each month. For example, - a set of month names used by a hypothetical - Icelandic FTP server might conceivably be specified as - <code>"jan|feb|mar|apr|maí|jún|júl|ágú|sep|okt|nóv|des"</code>. + <td>shortMonthNamesConfig</td> + <td>specify the month abbreviations used on the server in file timestamp dates as a + pipe-delimited string for each month. For example, a set of month names used by a hypothetical + Icelandic FTP server might conceivably be specified + as <q>jan|feb|mar|apr|maí|jún|júl|ágú|sep|okt|nóv|des</q>. This attribute exists primarily to support languages not supported by - the <b>serverLanguageCode</b> attribute.<br> - Since ant 1.7 - </td> - <td valign="top" align="center">No</td> + the <var>serverLanguageCode</var> attribute.<br/><em>Since Ant 1.7</em></td> + <td>No</td> </tr> </table> -<h3>Note about remotedir attribute</h3> -<table border="1" cellpadding="2" cellspacing="0" - > - <tbody> +<h3>Note about <var>remotedir</var> attribute</h3> +<table> + <thead> <tr> - <td style="vertical-align: top;" width="20%">Action<br> - </td> - <td style="vertical-align: top;" width="40%">meaning of <code>remotedir</code><br> - </td> - <td style="vertical-align: top;">use of nested <code>fileset</code> -(s)<br> - </td> + <th scope="col">Action</th> + <th scope="col">meaning of <var>remotedir</var></th> + <th scope="col">use of nested <var>fileset</var>(s)</th> </tr> + </thead> + <tbody> <tr> - <td style="vertical-align: top;" width="20%">send/put<br> - </td> - <td style="vertical-align: top;" width="40%">base directory to -which the files are sent<br> - </td> - <td style="vertical-align: top;">they are used normally and -evaluated on the local machine<br> - </td> + <td><q>send</q>/<q>put</q></td> + <td>base directory to which the files are sent</td> + <td>they are used normally and evaluated on the local machine</td> </tr> <tr> - <td style="vertical-align: top;" width="20%">recv/get<br> - </td> - <td style="vertical-align: top;" width="40%">base directory from -which the files are retrieved<br> - </td> - <td style="vertical-align: top;">the remote files located under -the <code>remotedir </code>matching the include/exclude patterns of -the <code>fileset </code></td> + <td><q>recv</q>/<q>get</q></td> + <td>base directory from which the files are retrieved</td> + <td>the remote files located under the <var>remotedir</var> matching the include/exclude + patterns of the <var>fileset</var></td> </tr> <tr> - <td style="vertical-align: top;" width="20%">del/delete<br> - </td> - <td style="vertical-align: top;" width="40%">base directory from -which files get deleted<br> - </td> - <td style="vertical-align: top;">the remote files located under -the <code>remotedir </code>matching the include/exclude patterns of -the <code>fileset <br> - </code></td> + <td><q>del</q>/<q>delete</q></td> + <td>base directory from which files get deleted</td> + <td>the remote files located under the <var>remotedir</var> matching the include/exclude + patterns of the <var>fileset</var></td> </tr> <tr> - <td style="vertical-align: top;" width="20%">list<br> - </td> - <td style="vertical-align: top;" width="40%">base directory from -which files are listed<br> - </td> - <td style="vertical-align: top;">the remote files located under -the <code>remotedir </code>matching the include/exclude patterns of -the <code>fileset <br> - </code></td> + <td><q>list</q></td> + <td>base directory from which files are listed</td> + <td>the remote files located under the <var>remotedir</var> matching the include/exclude + patterns of the <var>fileset</var></td> </tr> <tr> - <td style="vertical-align: top;" width="20%">mkdir</td> - <td style="vertical-align: top;" width="40%">directory to create<br> - </td> - <td style="vertical-align: top;">not used<br> - </td> + <td><q>mkdir</q></td> + <td>directory to create</td> + <td><em>not used</em></td> </tr> <tr> - <td style="vertical-align: top;" width="20%">chmod</td> - <td style="vertical-align: top;" width="40%">base directory from -which the mode of files get changed<br> - </td> - <td style="vertical-align: top;">the remote files located under -the <code>remotedir </code>matching the include/exclude patterns of -the <code>fileset <br> - </code></td> + <td><q>chmod</q></td> + <td>base directory from which the mode of files get changed</td> + <td>the remote files located under the <var>remotedir</var> matching the include/exclude + patterns of the <var>fileset</var></td> </tr> <tr> - <td style="vertical-align: top;" width="20%">rmdir<br> - </td> - <td style="vertical-align: top;" width="40%">base directory from -which directories get removed<br> - </td> - <td style="vertical-align: top;">the remote directories located -under the <code>remotedir </code>matching the include/exclude -patterns of the <code>fileset <br> - </code></td> + <td><q>rmdir</q></td> + <td>base directory from which directories get removed</td> + <td>the remote directories located under the <var>remotedir</var> matching the include/exclude + patterns of the <var>fileset</var></td> </tr> </tbody> -</table><h3>Parameters specified as nested elements</h3> +</table> +<h3>Parameters specified as nested elements</h3> <h4>fileset</h4> -<p>The ftp task supports any number of nested <a -href="../Types/fileset.html"><code><fileset></code></a> elements to specify -the files to be retrieved, or deleted, or listed, or whose mode you want to change.</p> -<p> -The attribute <code>followsymlinks</code> of <code>fileset</code> is supported on -local (put) as well as remote (get, chmod, delete, list) filesets. -<em>Before ant 1.6 there was no support of symbolic links in remote filesets. -In order to exclude symbolic links (preserve the behavior of ant 1.5.x and older), -you need to explicitly set <code>followsymlinks</code> to <code>false</code>.</em> -On remote filesets hidden files are not checked for being symbolic links. Hidden -files are currently assumed to not be symbolic links. -</p> +<p>The <code>ftp</code> task supports any number of +nested <a href="../Types/fileset.html"><code><fileset></code></a> elements to specify the +files to be retrieved, or deleted, or listed, or whose mode you want to change.</p> +<p>The attribute <var>followsymlinks</var> of <code>fileset</code> is supported on local - (<q>put</q>) as well as remote (<q>get</q>, <q>chmod</q>, <q>delete</q>) filesets. <em>Before Ant ++(<q>put</q>) as well as remote (<q>get</q>, <q>chmod</q>, <q>delete</q>, <q>list</q>) filesets. <em>Before Ant +1.6 there was no support of symbolic links in remote filesets. In order to exclude symbolic links +(preserve the behavior of Ant 1.5.x and older), you need to explicitly set <var>followsymlinks</var> +to <q>false</q>.</em> On remote filesets hidden files are not checked for being symbolic links. +Hidden files are currently assumed to not be symbolic links.</p> -<h3>Sending Files</h3> -<p>The easiest way to describe how to send files is with a couple of examples:</p> +<h3>Sending files</h3> +<p>The easiest way to describe how to send files is with a couple of examples.</p> +<p>Log in to <samp>ftp.apache.org</samp> as <samp>anonymous</samp> and upload all files in +the <samp>htdocs/manual</samp> directory to the default directory for that user.</p> <pre> - <ftp server="ftp.apache.org" - userid="anonymous" - password="[email protected]"> +<ftp server="ftp.apache.org" + userid="anonymous" + password="[email protected]"> <fileset dir="htdocs/manual"/> - </ftp> -</pre> -<p>Logs in to <code>ftp.apache.org</code> as <code>anonymous</code> and -uploads all files in the <code>htdocs/manual</code> directory -to the default directory for that user.</p> -<pre> <ftp server="ftp.apache.org" - remotedir="incoming" - userid="anonymous" - password="[email protected]" - depends="yes"> +</ftp></pre> + +<p>Log in to <samp>ftp.apache.org</samp> as <samp>anonymous</samp> and upload all new or changed +files in the <samp>htdocs/manual</samp> directory to the <samp>incoming</samp> directory relative to +the default directory for <samp>anonymous</samp>.</p> +<pre> +<ftp server="ftp.apache.org" + remotedir="incoming" + userid="anonymous" + password="[email protected]" + depends="yes"> <fileset dir="htdocs/manual"/> - </ftp></pre> -<p>Logs in to <code>ftp.apache.org</code> as <code>anonymous</code> and -uploads all new or changed files in the <code>htdocs/manual</code> directory -to the <code>incoming</code> directory relative to the default directory -for <code>anonymous</code>.</p> -<pre> <ftp server="ftp.apache.org" - port="2121" - remotedir="/pub/incoming" - userid="coder" - password="java1" - passive="yes" - depends="yes" - binary="no"> +</ftp></pre> + +<p>Log in to <samp>ftp.apache.org</samp> at port <samp>2121</samp> as <samp>coder</samp> with +password <samp>java1</samp> and upload all new or changed HTML files in +the <samp>htdocs/manual</samp> directory to the <samp>/pub/incoming</samp> directory. The files are +transferred in text mode. Passive mode has been switched on to send files from behind a +firewall.</p> +<pre> +<ftp server="ftp.apache.org" + port="2121" + remotedir="/pub/incoming" + userid="coder" + password="java1" + passive="yes" + depends="yes" + binary="no"> <fileset dir="htdocs/manual"> - <include name="**/*.html"/> + <include name="**/*.html"/> </fileset> - </ftp></pre> -<p>Logs in to <code>ftp.apache.org</code> at port <code>2121</code> as -<code>coder</code> with password <code>java1</code> and uploads all new or -changed HTML files in the <code>htdocs/manual</code> directory to the -<code>/pub/incoming</code> directory. The files are transferred in text mode. -Passive mode has been switched on to send files from behind a firewall.</p> -<pre> <ftp server="ftp.hypothetical.india.org" - port="2121" - remotedir="/pub/incoming" - userid="coder" - password="java1" - depends="yes" - binary="no" - systemTypeKey="Windows" - serverTimeZoneConfig="India/Calcutta"> +</ftp></pre> + +<p>Log in to a Windows server at <samp>ftp.hypothetical.india.org</samp> at port <samp>2121</samp> +as <samp>coder</samp> with password <samp>java1</samp> and upload all new or changed (accounting for +timezone differences) HTML files in the <samp>htdocs/manual</samp> directory to +the <samp>/pub/incoming</samp> directory. The files are transferred in text mode.</p> +<pre> +<ftp server="ftp.hypothetical.india.org" + port="2121" + remotedir="/pub/incoming" + userid="coder" + password="java1" + depends="yes" + binary="no" + systemTypeKey="Windows" + serverTimeZoneConfig="India/Calcutta"> <fileset dir="htdocs/manual"> - <include name="**/*.html"/> + <include name="**/*.html"/> </fileset> - </ftp></pre> -<p>Logs in to a Windows server at <code>ftp.hypothetical.india.org</code> -at port <code>2121</code> as <code>coder</code> with password <code>java1</code> -and uploads all new or changed (accounting for timezone differences) -HTML files in the <code>htdocs/manual</code> -directory to the <code>/pub/incoming</code> directory. The files are transferred -in text mode.</p> -<pre> <ftp server="ftp.nt.org" - remotedir="c:\uploads" - userid="coder" - password="java1" - separator="\" - verbose="yes"> +</ftp></pre> + +<p>Log in to the Windows-based <samp>ftp.nt.org</samp> as <samp>coder</samp> with +password <samp>java1</samp> and upload all HTML files in the <samp>htdocs/manual</samp> directory to +the <samp>c:\uploads</samp> directory. Progress messages are displayed as each file is uploaded.</p> +<pre> +<ftp server="ftp.nt.org" + remotedir="c:\uploads" + userid="coder" + password="java1" + separator="\" + verbose="yes"> <fileset dir="htdocs/manual"> - <include name="**/*.html"/> + <include name="**/*.html"/> </fileset> - </ftp></pre><p>Logs in to the Windows-based <code>ftp.nt.org</code> as -<code>coder</code> with password <code>java1</code> and uploads all -HTML files in the <code>htdocs/manual</code> directory to the -<code>c:\uploads</code> directory. Progress messages are displayed as each -file is uploaded.</p> -<h3>Getting Files</h3> -<p>Getting files from an FTP server works pretty much the same way as -sending them does. The only difference is that the nested filesets -use the remotedir attribute as the base directory for the files on the -FTP server, and the dir attribute as the local directory to put the files -into. The file structure from the FTP site is preserved on the local machine.</p> +</ftp></pre> + +<h3>Getting files</h3> +<p>Getting files from an FTP server works pretty much the same way as sending them does. The only +difference is that the nested filesets use the <var>remotedir</var> attribute as the base directory +for the files on the FTP server, and the <var>dir</var> attribute as the local directory to put the +files into. The file structure from the FTP site is preserved on the local machine.</p> + +<p>Log in to <samp>ftp.apache.org</samp> as <samp>anonymous</samp> and recursively download +all <samp>.html</samp> files from default directory for that user into +the <samp>htdocs/manual</samp> directory on the local machine.</p> <pre> - <ftp action="get" - server="ftp.apache.org" - userid="anonymous" - password="[email protected]"> +<ftp action="get" + server="ftp.apache.org" + userid="anonymous" + password="[email protected]"> <fileset dir="htdocs/manual"> - <include name="**/*.html"/> + <include name="**/*.html"/> </fileset> - </ftp> -</pre> -<p>Logs in to <code>ftp.apache.org</code> as <code>anonymous</code> and -recursively downloads all .html files from default directory for that user -into the <code>htdocs/manual</code> directory on the local machine.</p> +</ftp></pre> + +<p>If <samp>apache.org</samp> ever switches to a Unix FTP server that uses the new all-numeric +format for timestamps, this version would become necessary. It would accomplish the same +functionality as the previous example but would successfully handle the numeric +timestamps. The <var>systemTypeKey</var> is not necessary here but helps clarify what is going +on.</p> <pre> - <ftp action="get" - server="ftp.apache.org" - userid="anonymous" - password="[email protected]" - systemTypeKey="UNIX" - defaultDateFormatConfig="yyyy-MM-dd HH:mm"> +<ftp action="get" + server="ftp.apache.org" + userid="anonymous" + password="[email protected]" + systemTypeKey="UNIX" + defaultDateFormatConfig="yyyy-MM-dd HH:mm"> <fileset dir="htdocs/manual"> - <include name="**/*.html"/> + <include name="**/*.html"/> </fileset> - </ftp> -</pre> -<p>If apache.org ever switches to a unix FTP server that uses the new all-numeric -format for timestamps, this version would become necessary. It would accomplish -the same functionality as the previous example but would successfully handle the -numeric timestamps. -The <code>systemTypeKey</code> is not necessary here but helps clarify what is -going on.</p> +</ftp></pre> + +<p>Log into a UNIX FTP server at <samp>ftp.hypothetical.fr</samp> which displays dates with French +names in Standard European format, as <samp>anonymous</samp>, and recursively download +all <samp>.html</samp> files from default directory for that user into +the <samp>htdocs/manual</samp> directory on the local machine.</p> <pre> - <ftp action="get" - server="ftp.hypthetical.fr" - userid="anonymous" - password="[email protected]" - defaultDateFormatConfig="d MMM yyyy" - recentDateFormatConfig="d MMM HH:mm" - serverLanguageCodeConfig="fr"> - <fileset dir="htdocs/manual"> - <include name="**/*.html"/> +<ftp action="get" + server="ftp.hypthetical.fr" + userid="anonymous" + password="[email protected]" + defaultDateFormatConfig="d MMM yyyy" + recentDateFormatConfig="d MMM HH:mm" + serverLanguageCodeConfig="fr"> + <fileset dir="htdocs/manual"> + <include name="**/*.html"/> </fileset> - </ftp> -</pre> -<p>Logs into a UNIX FTP server at <code>ftp.hypothetical.fr</code> which displays -dates with French names in Standard European format, as <code>anonymous</code>, and -recursively downloads all .html files from default directory for that user -into the <code>htdocs/manual</code> directory on the local machine.</p> +</ftp></pre> -<h3>Deleting Files</h3> -As you've probably guessed by now, you use nested fileset elements to -select the files to delete from the remote FTP server. Again, the -filesets are relative to the remote directory, not a local directory. In -fact, the dir attribute of the fileset is ignored completely. +<h3>Deleting files</h3> +<p>As you've probably guessed by now, you use nested fileset elements to select the files to delete +from the remote FTP server. Again, the filesets are relative to the remote directory, not a local +directory. In fact, the <var>dir</var> attribute of the fileset is ignored completely.</p> +<p>Log in to <samp>ftp.apache.org</samp> as <samp>anonymous</samp> and try to delete +all <samp>*.tmp</samp> files from the default directory for that user. If you don't have permission +to delete a file, a <code>BuildException</code> is thrown.</p> <pre> - <ftp action="del" - server="ftp.apache.org" - userid="anonymous" - password="[email protected]"> +<ftp action="del" + server="ftp.apache.org" + userid="anonymous" + password="[email protected]"> <fileset> - <include name="**/*.tmp"/> + <include name="**/*.tmp"/> </fileset> - </ftp> -</pre> -<p>Logs in to <code>ftp.apache.org</code> as <code>anonymous</code> and -tries to delete all *.tmp files from the default directory for that user. -If you don't have permission to delete a file, a BuildException is thrown.</p> +</ftp></pre> + <h3>Listing Files</h3> +<p>Get a file listing in <samp>data/ftp.listing</samp> of all the files on the FTP server relative +to the default directory of the <samp>anonymous</samp> user. The listing is in whatever format the +FTP server normally lists files.</p> <pre> - <ftp action="list" - server="ftp.apache.org" - userid="anonymous" - password="[email protected]" - listing="data/ftp.listing"> +<ftp action="list" + server="ftp.apache.org" + userid="anonymous" + password="[email protected]" + listing="data/ftp.listing"> <fileset> - <include name="**"/> + <include name="**"/> </fileset> - </ftp> -</pre> -<p>This provides a file listing in <code>data/ftp.listing</code> of all the files on -the FTP server relative to the default directory of the <code>anonymous</code> -user. The listing is in whatever format the FTP server normally lists files.</p> +</ftp></pre> -<h3>Creating Directories</h3> -<p>Note that with the mkdir action, the directory to create is specified using the -remotedir attribute.</p> +<h3>Creating directories</h3> +<p>Note that with the <q>mkdir</q> action, the directory to create is specified using +the <var>remotedir</var> attribute.</p> +<p>Create the directory <samp>some/remote/dir</samp> 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.</p> <pre> - <ftp action="mkdir" - server="ftp.apache.org" - userid="anonymous" - password="[email protected]" - remotedir="some/remote/dir"/> -</pre> -<p>This creates the directory <code>some/remote/dir</code> 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.</p> -<h3>Removing Directories</h3> -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="mkdir" + server="ftp.apache.org" + userid="anonymous" + password="[email protected]" + remotedir="some/remote/dir"/></pre> -<pre> - <ftp action="rmdir" - server="ftp.apache.org" - userid="anonymous" - password="[email protected]" - remotedir="/somedir" > - <fileset> - <include name="dira"/> - <include name="dirb/**"/> - </fileset> - </ftp> -</pre> -<p>Logs in to <code>ftp.apache.org</code> as <code>anonymous</code> and -tries to remove <code>/somedir/dira</code> directory and -all the directories tree starting at, and including, <code>/somedir/dirb</code>. -When removing the <code>/somedir/dirb</code> 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. -Obviously all the files in the tree must have been already deleted. -</p> -<p>As an example suppose you want to delete everything contained into -<code>/somedir</code>, so invoke first the <code><ftp></code> task with -<code>action="delete"</code>, then with -<code>action="rmdir"</code> specifying in both cases -<code>remotedir="/somedir"</code> and +<h3>Removing directories</h3> +<p>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 <var>dir</var> +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 <code>BuildException</code> will be thrown. Also, if you don't have permission to remove +a directory, a <code>BuildException</code> is thrown.</p> +<p>Log in to <samp>ftp.apache.org</samp> as <samp>anonymous</samp> and try to +remove <samp>/somedir/dira</samp> directory and all the directory tree starting at, and +including, <samp>/somedir/dirb</samp>. When removing the <samp>/somedir/dirb</samp> tree, the task +starts 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. Obviously all the files in the tree must have +been already deleted.</p> <pre> +<ftp action="rmdir" + server="ftp.apache.org" + userid="anonymous" + password="[email protected]" + remotedir="/somedir" > <fileset> - <include name="**"/> + <include name="dira"/> + <include name="dirb/**"/> </fileset> -</pre> - -The directory specified in the <code>remotedir</code> parameter is never -selected for remove, so if you need to remove it, specify its parent in -<code>remotedir</code> parameter and include it in the -<code><fileset></code> pattern, like <code>"somedir/**"</code>. -</p> - +</ftp></pre> +<p>As an example suppose you want to delete everything contained in <samp>/somedir</samp>, so invoke +first the <code><ftp></code> task with <var>action</var>=<q>delete</q>, then +with <var>action</var>=<q>rmdir</q> specifying in both cases <var>remotedir</var>=<q>/somedir</q> +and</p> +<pre> +<fileset> + <include name="**"/> +</fileset></pre> +<p>The directory specified in the <var>remotedir</var> parameter is never selected for remove, so if +you need to remove it, specify its parent in <var>remotedir</var> parameter and include it in the +<code><fileset></code> pattern, like <samp>somedir/**</samp>.</p> </body> </html>
