Class RepositoryPolicy

java.lang.Object
org.eclipse.aether.repository.RepositoryPolicy

public final class RepositoryPolicy extends Object
A policy controlling access to a repository.
  • Field Details

  • Constructor Details

    • RepositoryPolicy

      Creates a new policy with checksum warnings and daily update checks.
    • RepositoryPolicy

      public RepositoryPolicy(boolean enabled, String updatePolicy, String checksumPolicy)
      Creates a new policy with the specified settings (uses same update policy for data and metadata, retains old resolver behaviour).
    • RepositoryPolicy

      public RepositoryPolicy(boolean enabled, String artifactUpdatePolicy, String metadataUpdatePolicy, String checksumPolicy)
      Creates a new policy with the specified settings.
      Parameters:
      enabled - A flag whether the associated repository should be accessed or not.
      artifactUpdatePolicy - The update interval after which locally cached data from the repository is considered stale and should be re-fetched, may be null.
      metadataUpdatePolicy - The update interval after which locally cached metadata from the repository is considered stale and should be re-fetched, may be null.
      checksumPolicy - The way checksum verification should be handled, may be null.
      Since:
      2.0.0
  • Method Details

    • isEnabled

      public boolean isEnabled()
      Indicates whether the associated repository should be contacted or not.
      Returns:
      true if the repository should be contacted, false otherwise.
    • getUpdatePolicy

      Deprecated.
      This method should not be used. Since version 2 Resolver internally distinguishes between artifact update policy and metadata update policy. This method was left only to preserve binary compatibility, and in reality invokes getArtifactUpdatePolicy().
      This method is not used in Resolver, as resolver internally strictly distinguishes between artifact and metadata update policies.
      See Also:
    • getArtifactUpdatePolicy

      Gets the update policy for locally cached artifacts from the repository.
      Returns:
      The update policy, never null.
      Since:
      2.0.0
    • getMetadataUpdatePolicy

      Gets the update policy for locally cached metadata from the repository.
      Returns:
      The update policy, never null.
      Since:
      2.0.0
    • getChecksumPolicy

      Gets the policy for checksum validation.
      Returns:
      The checksum policy, never null.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object