【问题标题】:Get files from FTP in ant在ant中从FTP获取文件
【发布时间】:2013-12-02 13:42:05
【问题描述】:

我有一个 FTP 文件夹结构,

-- 文件夹 1

-- 文件夹 2

-- 外部

      -- Code

-- 我的目录

现在,我想从这里获取文件夹“代码”。我正在使用代码,

<ftp action="get"
           server="server"
           userid="administrator"
           password="pass" >
        <fileset dir="Code">
        </fileset>
      </ftp> 

但这会让我的全部内容出现在 FTP 中,而不是只获得文件夹“代码”。

请告诉我。

【问题讨论】:

    标签: ant ftp


    【解决方案1】:

    嗨,我正在使用它,它对我有用 http://www.avajava.com/tutorials/lessons/how-do-i-ftp-a-file-with-ant.html

    已编辑:检索文件

    <ftp    action="get"
            server="server"
            userid="administrator"
            password="pass">
        <fileset dir="/path/to/Code">
            <include name="*"/>
        </fileset>
    </ftp>
    

    【讨论】:

    • 您好,您提供的链接用于“发送”文件。我想从 FTP 检索文件。
    • 不.. 这不起作用.... :-( 在上述情况下,我将文件集中的目录作为 /external/code 提供。但它不会从 FTP 返回任何文件夹或文件.
    • 尝试添加到 ftp 标签 remotedir="/" 或 remotedir=""
    • 添加了答案...请检查。
    【解决方案2】:

    远程目录必须在 Ftp 中使用。示例如下。

     <ftp action="get"
               server="sever"
               userid="user"
               password="pass"
                separator="/"
                remotedir="/remotedir">
    
            <fileset dir="e:/temp/">
                <include name="**/*" />
            </fileset>
          </ftp>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-07-25
      • 1970-01-01
      相关资源
      最近更新 更多