ant中ftp上传下载删除的用法

下载文件:

<!--  将154上最新编译的FTP资源SWF文件复制到本地目录-->

<target name="ftpSwfToLocal">

 <ftp action="get"

      server="10.45.7.154"

      userid="devflex"

      password="smart"

 remotedir="/ztesoft/devflex/java/webportal/WebContent/i18n/en_US/">

   <fileset dir="d:/javaWorkspace/cvbs/WebContent/i18n/en_US">

     <include name="**/*swf"/>

   </fileset>

 </ftp>

<echo message = "d:/javaWorkspace/cvbs/WebContent/i18n/en_US ---> ftpGet"/>

</target>

问题1、报错找不到“Could not create type ftp due to java.lang.NoClassDefFoundError:

                                  org/apache/commons/net/ftp/FTPClientConfig”

 

   解决:少了两个包:commons-net-1.4.1.jar和jakarta-oro-2.0.8.jar

   将这两个包加入到



 

 

 

<!--action不指定默认就是上传-->

<target name= "ftp.upload">
  <ftp server="xxx.xx.10.49"s
       userid="anonymous"
       password="me@myorg.com"
      remotedir="/second">
    <fileset dir=".">
      <include name="*.apk"/>
    </fileset>
  </ftp>
</target>

 

<!--假如要download的文件夹没有文件,那么空文件夹不会下载下来,删除同理-->

<target name= "ftp.download">
  <ftp action="get"
  server="xxx.xx.10.49"
       userid="anonymous"
       password="me@myorg.com"
  remotedir="second">
    <fileset dir="second">
  <include name="**"/> 
    </fileset>
  </ftp>
</target>

 

<target name= "ftp.del">
  <ftp action="del"
    server="xxx.xx.10.49"
        userid="anonymous"
       password="me@myorg.com" > 
   <fileset dir="second">    
   </fileset>

  </ftp>
</target>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值