This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Ant, Maven and Other Build Tools and the fly likes Ant FTP overwriting Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Ant FTP overwriting" Watch "Ant FTP overwriting" New topic
Author

Ant FTP overwriting

Kev D'Arcy
Ranch Hand

Joined: Jul 26, 2001
Posts: 75
Hi all,

I'm having a problem with the ant ftp task. When I execute it as part of
a build script I'd prefer that the task failed if the same file is
encountered on the server. Is this possible? I've tried using the "depends"
attribute, but this always allows an update.

Thanks,

Kev
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30057
    
149

Kev,
The depends attribute only checks if your file is newer. This is likely if it is generated by the Ant build.

The FTP task itself doesn't provide a way to check if the file is already on the server. You could use an FTP get to see if it exists though.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Ant FTP overwriting
 
Similar Threads
Ant andsecure ftp
ant scripting - how to copy an image from one mch to another
Loadjava program
getting file to local system from server
Copy Files to Remote System from Local using ANT