天天看點

Ant步步為營(2)在ftp上下載下傳需要的檔案

早上好,開始一天工作之前先踩踩了園子,今天介紹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,所有英語要過關)

繼續閱讀