Class DefaultChecksumPolicyProvider

    • Method Detail

      • newChecksumPolicy

        public ChecksumPolicy newChecksumPolicy​(RepositorySystemSession session,
                                                RemoteRepository repository,
                                                TransferResource resource,
                                                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 interface ChecksumPolicyProvider
        Parameters:
        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.
        Returns:
        The policy to apply or null if checksums should be ignored.
      • getEffectiveChecksumPolicy

        public String getEffectiveChecksumPolicy​(RepositorySystemSession session,
                                                 String policy1,
                                                 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 interface ChecksumPolicyProvider
        Parameters:
        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.
        Returns:
        The least strict policy among the two input policies.