ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter.FL...@syntegra.com
Subject RE: FTP
Date Thu, 11 Oct 2001 11:35:49 GMT
Dhirendra,

I build this using the documentation provided in the 1.4 optional tasks
documentation.

Here is some XML that uploads and downloads to an FTP server.   I hope it
helps you out.

<?xml version="1.0"?>
<project name="ftpTest" basedir="." default="usage">
    <target name="upload">
        <echo message="Uploading contents of C:\Temp to remote directory
/ftptest on ftpserver"/>
        <ftp server="ftpserver" remotedir="/ftptest" userid="guest"
password="guest" binary="yes" action="put" verbose="yes">
          <fileset dir="C:\Temp">
                  <include name="**/*.*"/>
              </fileset>
        </ftp>
    </target>

    <target name="download">
        <echo message="Downloading contents of remote directory /ftptest on
ftpserver to my current directory."/>
        <ftp server="ftpserver" remotedir="/ftptest" userid="guest"
password="guest" binary="yes" action="get" verbose="yes">
          <fileset dir=".">
                  <include name="**/*.*"/>
              </fileset>
        </ftp>
    </target>

    <target name="usage">
        <echo message="Usage: ant upload|download" />
    </target>

</project>

When run, you will receive the following output:

D:\ftptest>ant
Buildfile: build.xml

usage:
     [echo] Usage: ant upload|download

BUILD SUCCESSFUL

Total time: 1 second

D:\ftptest>ant upload
Buildfile: build.xml

upload:
     [echo] Uploading contents of C:\Temp to remote directory /ftptest on
ftpserver
      [ftp] sending files
      [ftp] transferring C:\Temp\test.txt
      [ftp] 1 files sent

BUILD SUCCESSFUL

Total time: 1 second
D:\ftptest>ant download
Buildfile: build.xml

download:
     [echo] Downloading contents of remote directory /ftptest on ftpserver
to .
      [ftp] getting files
      [ftp] transferring test.txt to D:\ftptest\test.txt
      [ftp] 1 files retrieved

BUILD SUCCESSFUL
 
 

 
 
 


********************************************************************

This email may contain information which is privileged or confidential. If you are not the
intended recipient of this email, please notify the sender immediately and delete it without
reading, copying, storing, forwarding or disclosing its contents to any other person
Thank you

Check us out at http://www.syntegra.com

********************************************************************

Mime
View raw message