早上好,开始一天工作之前先踩踩了园子,今天介绍ftp上下载文件。
<?xml version="1.0"?>
<project name="ForTest"
default="ftp.download" >
<property
file="build.properties"></property>
<target name= "ftp.download">
<ftp action="get"
server="192.168.**.**"
userid="admin"
password="admin"
remotedir="/">
<fileset dir="${file.dir}">
<include name="**"/>
</fileset>
</ftp>
</target>
</project>
> <include name="**"/>此句是在ftp上筛选想要的文件。
> action="get"这个需要声明,如果action不指定默认就是上传。
> http://www.cnblogs.com/lightideal/archive/2012/02/27/2370210.html
> 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.(学习新知识,着手API,所有英语要过关)
Ant步步为营(2)在ftp上下载需要的文件,码迷,mamicode.com
原文地址:http://www.cnblogs.com/QAZLIU/p/3698560.html