org.apache.archiva.policies
Class ChecksumPolicy

java.lang.Object
  extended by org.apache.archiva.policies.ChecksumPolicy
All Implemented Interfaces:
DownloadPolicy, Policy, PostDownloadPolicy

@Service(value="postDownloadPolicy#checksum")
public class ChecksumPolicy
extends 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
private  ChecksumAlgorithm[] algorithms
           
static 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 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 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.
private  org.slf4j.Logger log
           
private  List<String> options
           
 
Constructor Summary
ChecksumPolicy()
           
 
Method Summary
 void applyPolicy(String policySetting, Properties request, File localFile)
          Apply the download policy.
 String getDefaultOption()
          Get the default option for this policy.
 String getId()
          Get the id for this policy.
 String getName()
          Get the display name for this policy.
 List<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

log

private org.slf4j.Logger log

IGNORE

public static final 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 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 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

algorithms

private ChecksumAlgorithm[] algorithms

options

private List<String> options
Constructor Detail

ChecksumPolicy

public ChecksumPolicy()
Method Detail

applyPolicy

public void applyPolicy(String policySetting,
                        Properties request,
                        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 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 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 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 List<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.


Copyright © 2006-2013 The Apache Software Foundation. All Rights Reserved.