Dhinesh M
Dhinesh M

Reputation: 21

Get files from FTP in ant

I have a FTP folder structure as,

-- Folder 1

-- Folder 2

-- external

      -- Code

-- MY Dir

Now, I want to get the folder "Code" from here. I am using the code,

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

But this gets my whole contents present in the FTP rather than getting only the folder "Code".

Please let me know.

Upvotes: 1

Views: 2701

Answers (2)

Dhinesh M
Dhinesh M

Reputation: 21

remote dir has to be used within the Ftp. The example is given below.

 <ftp action="get"
           server="sever"
           userid="user"
           password="pass"
            separator="/"
            remotedir="/remotedir">

        <fileset dir="e:/temp/">
            <include name="**/*" />
        </fileset>
      </ftp>

Upvotes: 0

user3057486
user3057486

Reputation: 129

Hi I'm using this and i t works for me http://www.avajava.com/tutorials/lessons/how-do-i-ftp-a-file-with-ant.html

edited: retrive files

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

Upvotes: 1

Related Questions