ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vijay Aravamudhan <avij...@gmail.com>
Subject Verifying checksum of files after ftp'ing to remote server
Date Mon, 03 Mar 2008 20:51:25 GMT
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@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message