This project has retired. For details please refer to its Attic page.
ChecksumPolicy

org.apache.maven.archiva.policies
Class ChecksumPolicy

Package class diagram package ChecksumPolicy
java.lang.Object
  extended by org.apache.maven.archiva.policies.ChecksumPolicy
All Implemented Interfaces:
DownloadPolicy, Policy, PostDownloadPolicy

public class ChecksumPolicy
extends java.lang.Object
implements PostDownloadPolicy

ChecksumPolicy - a policy applied after the download to see if the file has been downloaded successfully and completely (or not).


Field Summary
static java.lang.String FAIL
          The FAIL policy indicates that if the checksum does not match the downloaded file, then remove the downloaded artifact, and checksum files, and fail the transfer to the client side.
static java.lang.String FIX
          The FIX policy indicates that if the checksum does not match the downloaded file, then fix the checksum file locally, and return to the client side the corrected checksum.
static java.lang.String IGNORE
          The IGNORE policy indicates that if the checksum policy is ignored, and the state of, contents of, or validity of the checksum files are not checked.
 
Constructor Summary
ChecksumPolicy()
           
 
Method Summary
 void applyPolicy(java.lang.String policySetting, java.util.Properties request, java.io.File localFile)
          Apply the download policy.
 java.lang.String getDefaultOption()
          Get the default option for this policy.
 java.lang.String getId()
          Get the id for this policy.
 java.lang.String getName()
          Get the display name for this policy.
 java.util.List<java.lang.String> getOptions()
          Get the list of options for this policy.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IGNORE

public static final java.lang.String IGNORE
The IGNORE policy indicates that if the checksum policy is ignored, and the state of, contents of, or validity of the checksum files are not checked.

See Also:
Constant Field Values

FAIL

public static final java.lang.String FAIL
The FAIL policy indicates that if the checksum does not match the downloaded file, then remove the downloaded artifact, and checksum files, and fail the transfer to the client side.

See Also:
Constant Field Values

FIX

public static final java.lang.String FIX
The FIX policy indicates that if the checksum does not match the downloaded file, then fix the checksum file locally, and return to the client side the corrected checksum.

See Also:
Constant Field Values
Constructor Detail

ChecksumPolicy

public ChecksumPolicy()
Method Detail

applyPolicy

public void applyPolicy(java.lang.String policySetting,
                        java.util.Properties request,
                        java.io.File localFile)
                 throws PolicyViolationException,
                        PolicyConfigurationException
Description copied from interface: DownloadPolicy
Apply the download policy.

Specified by:
applyPolicy in interface DownloadPolicy
Parameters:
policySetting - the policy setting.
request - the list of request properties that the policy might use.
Throws:
PolicyViolationException - if the policy has been violated.
PolicyConfigurationException

getDefaultOption

public java.lang.String getDefaultOption()
Description copied from interface: Policy
Get the default option for this policy.

Specified by:
getDefaultOption in interface Policy
Returns:
the default policy for this policy.

getId

public java.lang.String getId()
Description copied from interface: Policy
Get the id for this policy.

Specified by:
getId in interface Policy
Returns:
the id for this policy.

getName

public java.lang.String getName()
Description copied from interface: Policy
Get the display name for this policy.

Specified by:
getName in interface Policy
Returns:
the name for this policy

getOptions

public java.util.List<java.lang.String> getOptions()
Description copied from interface: Policy
Get the list of options for this policy.

Specified by:
getOptions in interface Policy
Returns:
the list of options for this policy.