org.eclipse.aether.internal.impl

## Class DefaultChecksumPolicyProvider

- java.lang.Object
- - org.eclipse.aether.internal.impl.DefaultChecksumPolicyProvider

- All Implemented Interfaces:
    ChecksumPolicyProvider, Service

      @Named
      public final class DefaultChecksumPolicyProvider
      extends Object
      implements ChecksumPolicyProvider, Service

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultChecksumPolicyProvider()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `getEffectiveChecksumPolicy(RepositorySystemSession session, String policy1, String policy2)` Returns the least strict policy.
    `void` | `initService(ServiceLocator locator)` Provides the opportunity to initialize this service and to acquire other services for its operation from the locator.
    `ChecksumPolicy` | `newChecksumPolicy(RepositorySystemSession session, RemoteRepository repository, TransferResource resource, String policy)` Retrieves the checksum policy with the specified identifier for use on the given remote resource.
    `DefaultChecksumPolicyProvider` | `setLoggerFactory(LoggerFactory loggerFactory)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### DefaultChecksumPolicyProvider

          public DefaultChecksumPolicyProvider()

  - ### Method Detail

    - #### initService

          public void initService(ServiceLocator locator)

      Description copied from interface: `Service`
      Provides the opportunity to initialize this service and to acquire other services for its operation from the locator. A service must not save the reference to the provided service locator.
      Specified by:
        `initService` in interface `Service`
      Parameters:
        `locator` - The service locator, must not be `null`.

    - #### setLoggerFactory

          public DefaultChecksumPolicyProvider setLoggerFactory(LoggerFactory loggerFactory)

    - #### 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.

Copyright © 2010-2014 The Eclipse Foundation. All Rights Reserved.