Package org.eclipse.aether.internal.impl
Class AbstractChecksumPolicy
java.lang.Object
org.eclipse.aether.internal.impl.AbstractChecksumPolicy
- All Implemented Interfaces:
ChecksumPolicy
- Direct Known Subclasses:
FailChecksumPolicy,WarnChecksumPolicy
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.aether.spi.connector.checksum.ChecksumPolicy
ChecksumPolicy.ChecksumKind -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final org.slf4j.Loggerprotected final TransferResource -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidonChecksumError(String algorithm, ChecksumPolicy.ChecksumKind kind, ChecksumFailureException exception) Signals an error while computing the local checksum value or retrieving the checksum value from the remote repository.booleanonChecksumMatch(String algorithm, ChecksumPolicy.ChecksumKind kind) Signals a match between the locally computed checksum value and the checksum value declared by the remote repository.voidonChecksumMismatch(String algorithm, ChecksumPolicy.ChecksumKind kind, ChecksumFailureException exception) Signals a mismatch between the locally computed checksum value and the checksum value declared by the remote repository.voidSignals that all available checksums have been processed.voidSignals that the download is being retried after a previously thrownChecksumFailureExceptionthat isretry-worthy.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.aether.spi.connector.checksum.ChecksumPolicy
onTransferChecksumFailure
-
Field Details
-
logger
protected final org.slf4j.Logger logger -
resource
-
-
Constructor Details
-
AbstractChecksumPolicy
-
-
Method Details
-
onChecksumMatch
Description copied from interface:ChecksumPolicySignals a match between the locally computed checksum value and the checksum value declared by the remote repository.- Specified by:
onChecksumMatchin interfaceChecksumPolicy- Parameters:
algorithm- The name of the checksum algorithm being used, must not benull.kind- A field providing further details about the checksum.- Returns:
trueto accept the download as valid and stop further validation,falseto continue validation with the next checksum.
-
onChecksumMismatch
public void onChecksumMismatch(String algorithm, ChecksumPolicy.ChecksumKind kind, ChecksumFailureException exception) throws ChecksumFailureException Description copied from interface:ChecksumPolicySignals a mismatch between the locally computed checksum value and the checksum value declared by the remote repository. A simple policy would just rethrow the provided exception. More sophisticated policies could update their internal state and defer a conclusion until all available checksums have been processed.- Specified by:
onChecksumMismatchin interfaceChecksumPolicy- Parameters:
algorithm- The name of the checksum algorithm being used, must not benull.kind- A field providing further details about the checksum.exception- The exception describing the checksum mismatch, must not benull.- Throws:
ChecksumFailureException- If the checksum validation is to be failed. If the method returns normally, validation continues with the next checksum.
-
onChecksumError
public void onChecksumError(String algorithm, ChecksumPolicy.ChecksumKind kind, ChecksumFailureException exception) throws ChecksumFailureException Description copied from interface:ChecksumPolicySignals an error while computing the local checksum value or retrieving the checksum value from the remote repository.- Specified by:
onChecksumErrorin interfaceChecksumPolicy- Parameters:
algorithm- The name of the checksum algorithm being used, must not benull.kind- A field providing further details about the checksum.exception- The exception describing the checksum error, must not benull.- Throws:
ChecksumFailureException- If the checksum validation is to be failed. If the method returns normally, validation continues with the next checksum.
-
onNoMoreChecksums
Description copied from interface:ChecksumPolicySignals that all available checksums have been processed.- Specified by:
onNoMoreChecksumsin interfaceChecksumPolicy- Throws:
ChecksumFailureException- If the checksum validation is to be failed. If the method returns normally, the download is assumed to be valid.
-
onTransferRetry
public void onTransferRetry()Description copied from interface:ChecksumPolicySignals that the download is being retried after a previously thrownChecksumFailureExceptionthat isretry-worthy. Policies that maintain internal state will usually have to reset some of this state at this point to prepare for a new round of validation.- Specified by:
onTransferRetryin interfaceChecksumPolicy
-