antoine 2003/08/06 03:58:24 Modified: src/testcases/org/apache/tools/ant/taskdefs/optional/net FTPTest.java src/main/org/apache/tools/ant/taskdefs/optional/net FTP.java docs/manual/OptionalTasks ftp.html Log: Fix the ftp task, its documentation and testcases to maintain backward compatibility. Revision Changes Path 1.4 +5 -5 ant/src/testcases/org/apache/tools/ant/taskdefs/optional/net/FTPTest.java Index: FTPTest.java =================================================================== RCS file: /home/cvs/ant/src/testcases/org/apache/tools/ant/taskdefs/optional/net/FTPTest.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- FTPTest.java 5 Aug 2003 23:18:25 -0000 1.3 +++ FTPTest.java 6 Aug 2003 10:58:24 -0000 1.4 @@ -157,7 +157,7 @@ ds.scan(); compareFiles(ds, new String[] {"alpha/beta/beta.xml", "alpha/beta/gamma/gamma.xml"}, - new String[] {"", "alpha", "alpha/beta", + new String[] {"alpha", "alpha/beta", "alpha/beta/gamma"}); } } @@ -218,6 +218,7 @@ FTP.FTPDirectoryScanner ds = myFTPTask.newScanner(ftp); ds.setBasedir(new File(getProject().getBaseDir(), "tmp")); ds.setIncludes(new String[] {"alpha/beta/gamma/"}); + ds.setFollowSymlinks(true); ds.scan(); compareFiles(ds, new String[] {"alpha/beta/gamma/gamma.xml"}, new String[] {"alpha/beta/gamma"}); @@ -255,6 +256,7 @@ FTP.FTPDirectoryScanner ds = myFTPTask.newScanner(ftp); ds.setBasedir(new File(getProject().getBaseDir(), "tmp")); ds.setIncludes(new String[] {"alpha/beta/gamma/"}); + ds.setFollowSymlinks(true); ds.scan(); compareFiles(ds, new String[] {"alpha/beta/gamma/gamma.xml"}, new String[] {"alpha/beta/gamma"}); @@ -481,10 +483,9 @@ FTP.FTPDirectoryScanner ds = myFTPTask.newScanner(ftp); ds.setBasedir(new File(getProject().getBaseDir(), "tmp")); ds.setExcludes(new String[] {"alpha/**"}); - ds.setFollowSymlinks(false); ds.scan(); compareFiles(ds, new String[] {"delta/delta.xml"}, - new String[] {"", "delta"}); + new String[] {"delta"}); ds = myFTPTask.newScanner(ftp); if (!changeRemoteDir(remoteTmpDir)) { @@ -492,12 +493,11 @@ } ds.setBasedir(new File(getProject().getBaseDir(), "tmp")); ds.setExcludes(new String[] {"alpha"}); - ds.setFollowSymlinks(false); ds.scan(); compareFiles(ds, new String[] {"alpha/beta/beta.xml", "alpha/beta/gamma/gamma.xml", "delta/delta.xml"}, - new String[] {"", "alpha/beta", "alpha/beta/gamma", "delta"}); + new String[] {"alpha/beta", "alpha/beta/gamma", "delta"}); } 1.43 +4 -11 ant/src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java Index: FTP.java =================================================================== RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java,v retrieving revision 1.42 retrieving revision 1.43 diff -u -r1.42 -r1.43 --- FTP.java 5 Aug 2003 22:59:16 -0000 1.42 +++ FTP.java 6 Aug 2003 10:58:24 -0000 1.43 @@ -177,6 +177,9 @@ * internal class allowing to read the contents of a remote file system * using the FTP protocol * used in particular for ftp get operations + * differences with DirectoryScanner + * "" (the root of the fileset) is never included in the included directories + * followSymlinks defaults to false */ protected class FTPDirectoryScanner extends DirectoryScanner { protected FTPClient ftp = null; @@ -189,6 +192,7 @@ public FTPDirectoryScanner(FTPClient ftp) { super(); this.ftp = ftp; + this.setFollowSymlinks(false); } @@ -215,17 +219,6 @@ try { String cwd = ftp.printWorkingDirectory(); - // register also the root directory of the fileset if it matches - // include and exclude patterns - if (isIncluded("")) { - if (!isExcluded("")) { - dirsIncluded.addElement(""); - } else { - dirsExcluded.addElement(""); - } - } else { - dirsNotIncluded.addElement(""); - } // always start from the current ftp working dir scandir(".", "", true); 1.16 +13 -0 ant/docs/manual/OptionalTasks/ftp.html Index: ftp.html =================================================================== RCS file: /home/cvs/ant/docs/manual/OptionalTasks/ftp.html,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- ftp.html 31 Oct 2002 07:29:31 -0000 1.15 +++ ftp.html 6 Aug 2003 10:58:24 -0000 1.16 @@ -150,6 +150,19 @@ <td valign="top" align="center">No; defaults to false.</td> </tr> </table> +<h3>Parameters specified as nested elements</h3> +<h4>fileset</h4> +<p>The ftp task supports any number of nested <a +href="../CoreTypes/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> +<code>followsymlinks</code> defaults to <code>false</code> for remote filesets. +Remote filesets are used for all actions except put. +</p> +<p> +Remote filesets do not support selectors.<br/> +</p> + <h3>Sending Files</h3> <p>The easiest way to describe how to send files is with a couple of examples:</p> <pre>
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]