@Singleton @Named public final class DefaultChecksumPolicyProvider extends java.lang.Object implements ChecksumPolicyProvider
Modifier and Type | Field and Description |
---|---|
private static int |
ORDINAL_FAIL |
private static int |
ORDINAL_IGNORE |
private static int |
ORDINAL_WARN |
Constructor and Description |
---|
DefaultChecksumPolicyProvider() |
Modifier and Type | Method and 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) |
private static void |
validatePolicy(java.lang.String paramName,
java.lang.String policy) |
private static final int ORDINAL_IGNORE
private static final int ORDINAL_WARN
private static final int ORDINAL_FAIL
public ChecksumPolicy newChecksumPolicy(RepositorySystemSession session, RemoteRepository repository, TransferResource resource, java.lang.String policy)
ChecksumPolicyProvider
newChecksumPolicy
in interface ChecksumPolicyProvider
session
- The repository system session during which the request is made, must not be null
.repository
- The repository hosting the resource being transferred, must not be null
.resource
- The transfer resource on which the policy will be applied, must not be null
.policy
- The identifier of the policy to apply, must not be null
.null
if checksums should be ignored.public java.lang.String getEffectiveChecksumPolicy(RepositorySystemSession session, java.lang.String policy1, java.lang.String policy2)
ChecksumPolicyProvider
getEffectiveChecksumPolicy
in interface ChecksumPolicyProvider
session
- The repository system session during which the request is made, must not be null
.policy1
- A policy to compare, must not be null
.policy2
- A policy to compare, must not be null
.private static int ordinalOfPolicy(java.lang.String policy)
private static void validatePolicy(java.lang.String paramName, java.lang.String policy)