Package org.eclipse.aether.internal.impl
Class DefaultChecksumPolicyProvider
- java.lang.Object
-
- org.eclipse.aether.internal.impl.DefaultChecksumPolicyProvider
-
- All Implemented Interfaces:
ChecksumPolicyProvider
@Named public final class DefaultChecksumPolicyProvider extends java.lang.Object implements ChecksumPolicyProvider
-
-
Field Summary
Fields Modifier and Type Field Description private static int
ORDINAL_FAIL
private static int
ORDINAL_IGNORE
private static int
ORDINAL_WARN
-
Constructor Summary
Constructors Constructor Description DefaultChecksumPolicyProvider()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getEffectiveChecksumPolicy(RepositorySystemSession session, java.lang.String policy1, java.lang.String policy2)
Returns the least strict policy.ChecksumPolicy
newChecksumPolicy(RepositorySystemSession session, RemoteRepository repository, TransferResource resource, java.lang.String policy)
Retrieves the checksum policy with the specified identifier for use on the given remote resource.private static int
ordinalOfPolicy(java.lang.String policy)
-
-
-
Field Detail
-
ORDINAL_IGNORE
private static final int ORDINAL_IGNORE
- See Also:
- Constant Field Values
-
ORDINAL_WARN
private static final int ORDINAL_WARN
- See Also:
- Constant Field Values
-
ORDINAL_FAIL
private static final int ORDINAL_FAIL
- See Also:
- Constant Field Values
-
-
Method Detail
-
newChecksumPolicy
public ChecksumPolicy newChecksumPolicy(RepositorySystemSession session, RemoteRepository repository, TransferResource resource, java.lang.String policy)
Description copied from interface:ChecksumPolicyProvider
Retrieves the checksum policy with the specified identifier for use on the given remote resource.- Specified by:
newChecksumPolicy
in interfaceChecksumPolicyProvider
- Parameters:
session
- The repository system session during which the request is made, must not benull
.repository
- The repository hosting the resource being transferred, must not benull
.resource
- The transfer resource on which the policy will be applied, must not benull
.policy
- The identifier of the policy to apply, must not benull
.- Returns:
- The policy to apply or
null
if checksums should be ignored.
-
getEffectiveChecksumPolicy
public java.lang.String getEffectiveChecksumPolicy(RepositorySystemSession session, java.lang.String policy1, java.lang.String policy2)
Description copied from interface:ChecksumPolicyProvider
Returns the least strict policy. A checksum policy is said to be less strict than another policy if it would accept a downloaded resource in all cases where the other policy would reject the resource.- Specified by:
getEffectiveChecksumPolicy
in interfaceChecksumPolicyProvider
- Parameters:
session
- The repository system session during which the request is made, must not benull
.policy1
- A policy to compare, must not benull
.policy2
- A policy to compare, must not benull
.- Returns:
- The least strict policy among the two input policies.
-
ordinalOfPolicy
private static int ordinalOfPolicy(java.lang.String policy)
-
-