de.undercouch.gradle.tasks.download
Class VerifyAction

java.lang.Object
  extended by de.undercouch.gradle.tasks.download.VerifyAction
All Implemented Interfaces:
VerifySpec

public class VerifyAction
extends java.lang.Object
implements VerifySpec

Verifies a file's integrity by calculating its checksum.


Constructor Summary
VerifyAction(org.gradle.api.Project project)
          Creates a new verify action
 
Method Summary
 void algorithm(java.lang.String algorithm)
          Set the algorithm to use to compute the checksum.
 void checksum(java.lang.String checksum)
          Set the actual checksum to verify against
 void execute()
          Starts verifying
 java.lang.String getAlgorithm()
           
 java.lang.String getChecksum()
           
 java.io.File getSrc()
           
 void src(java.lang.Object src)
          Sets the file to verify
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VerifyAction

public VerifyAction(org.gradle.api.Project project)
Creates a new verify action

Parameters:
project - the project to be built
Method Detail

execute

public void execute()
             throws java.io.IOException,
                    java.security.NoSuchAlgorithmException
Starts verifying

Throws:
java.io.IOException - if the file could not verified
java.security.NoSuchAlgorithmException - if the given algorithm is not available

src

public void src(java.lang.Object src)
Description copied from interface: VerifySpec
Sets the file to verify

Specified by:
src in interface VerifySpec
Parameters:
src - the file (either a filename or a File object)

algorithm

public void algorithm(java.lang.String algorithm)
Description copied from interface: VerifySpec
Set the algorithm to use to compute the checksum. Defaults to "MD5" (see the list of algorithm names for more information).

Specified by:
algorithm in interface VerifySpec
Parameters:
algorithm - the name of the algorithm

checksum

public void checksum(java.lang.String checksum)
Description copied from interface: VerifySpec
Set the actual checksum to verify against

Specified by:
checksum in interface VerifySpec
Parameters:
checksum - the checksum (in hex)

getSrc

public java.io.File getSrc()
Specified by:
getSrc in interface VerifySpec
Returns:
the file to verify

getAlgorithm

public java.lang.String getAlgorithm()
Specified by:
getAlgorithm in interface VerifySpec
Returns:
the algorithm to use to compute the checksum

getChecksum

public java.lang.String getChecksum()
Specified by:
getChecksum in interface VerifySpec
Returns:
the actual checksum to verify against (in hex)