我正在尝试使用 ant 从 ftp 服务器下载子目录中的文件。确切的文件集是已知的。其中一些位于子目录中。Ant似乎只下载根目录中的那些。如果我下载所有文件而不列出它们,它确实有效。
第一个 ftp 操作应该与第二个操作完全相同。相反,我得到“假定不是符号链接的隐藏文件 \\a\a.txt”。
有谁知道这里有什么问题?这是 ant FTP 任务中的错误吗?
<?xml version="1.0" encoding="utf-8"?>
<project name="example" default="example" basedir=".">
<taskdef name="ftp"
classname="org.apache.tools.ant.taskdefs.optional.net.FTP" />
<target name="example">
<!-- doesn't work -->
<ftp action="get" verbose="true"
server="localhost" userid="example" password="example"
remotedir="">
<fileset dir="downloads" casesensitive="false"
includes="a/a.txt,a/b/ab.txt,c/c.txt" />
</ftp>
<!-- works (but requires multiple ftp tasks) -->
<ftp action="get" verbose="true"
server="localhost" userid="example" password="example"
remotedir="a">
<fileset dir="downloads" casesensitive="false"
includes="a.txt,b/ab.txt" />
</ftp>
<ftp action="get" verbose="true"
server="localhost" userid="example" password="example"
remotedir="c">
<fileset dir="downloads" casesensitive="false"
includes="c.txt" />
</ftp>
</target>
</project>
更新:我向 Commons Net jira https://issues.apache.org/jira/browse/NET-324发布了一个关于此的错误
更新:我在 ant bugreport 系统中添加了一个 bugreport https://issues.apache.org/bugzilla/show_bug.cgi?id=49296