Java Mailing List Archive

http://www.ant-tasks.com/

Home » Ant Users List »

Verifying checksum of files after ftp'ing to remote server

Vijay Aravamudhan

2008-03-03


Author LoginPost Reply
hi,
In our build process, some files are ftp'ed onto a remote server. I
would like to incorporate a step that can be used to verify that the ftp
process worked correctly - by verifying the checksum of the local
file(s) to the corresponding remote one(s). Could someone please help
with how this can be done?
I have looked at the checksum task - but am not sure how to do this for
a file that resides on a remote ftp server.

Here is a code snippet of the ant file that I would like to use:
  <target name="md5-checksums">
    <checksum file="${local.zip.file}" property="md5.local"/>
    <checksum file="${remote.zip.file}" property="md5.remote"/>
    <condition property="md5.isValid">
       <equals arg1="${md5.local}" arg2="${md5.remote}"/>
    </condition>
    <if>
       <istrue value="${md5.isValid}"/>
       <then>
          <echo>${local.zip.file}: ok</echo>
       </then>
       <else>
          <fail message="${local.zip.file}: Wrong MD5 checksum !!!"/>
       </else>
    </if>
  </target>

thanks,
Vijay

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

©2008 ant-tasks.com - Jax Systems, LLC, U.S.A.