Package org.eclipse.aether.repository
Class RepositoryPolicy
- java.lang.Object
-
- org.eclipse.aether.repository.RepositoryPolicy
-
public final class RepositoryPolicy extends java.lang.Object
A policy controlling access to a repository.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCHECKSUM_POLICY_FAILEnforce presence of checksums and fail the resolution if they do not match or are absent.static java.lang.StringCHECKSUM_POLICY_IGNOREIgnore presence and verification of checksums.static java.lang.StringCHECKSUM_POLICY_WARNExpect presence of checksums and warn if they do not match or are absent.static java.lang.StringUPDATE_POLICY_ALWAYSAlways update locally cached data.static java.lang.StringUPDATE_POLICY_DAILYUpdate locally cached data once a day.static java.lang.StringUPDATE_POLICY_INTERVALUpdate locally cached data every X minutes as given by "interval:X".static java.lang.StringUPDATE_POLICY_NEVERNever update locally cached data.
-
Constructor Summary
Constructors Constructor Description RepositoryPolicy()Creates a new policy with checksum warnings and daily update checks.RepositoryPolicy(boolean enabled, java.lang.String updatePolicy, java.lang.String checksumPolicy)Creates a new policy with the specified settings (uses same update policy for data and metadata, retains old resolver behaviour).RepositoryPolicy(boolean enabled, java.lang.String artifactUpdatePolicy, java.lang.String metadataUpdatePolicy, java.lang.String checksumPolicy)Creates a new policy with the specified settings.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)java.lang.StringgetArtifactUpdatePolicy()Gets the update policy for locally cached artifacts from the repository.java.lang.StringgetChecksumPolicy()Gets the policy for checksum validation.java.lang.StringgetMetadataUpdatePolicy()Gets the update policy for locally cached metadata from the repository.java.lang.StringgetUpdatePolicy()Deprecated.This method should not be used.inthashCode()booleanisEnabled()Indicates whether the associated repository should be contacted or not.java.lang.StringtoString()
-
-
-
Field Detail
-
UPDATE_POLICY_NEVER
public static final java.lang.String UPDATE_POLICY_NEVER
Never update locally cached data.- See Also:
- Constant Field Values
-
UPDATE_POLICY_ALWAYS
public static final java.lang.String UPDATE_POLICY_ALWAYS
Always update locally cached data.- See Also:
- Constant Field Values
-
UPDATE_POLICY_DAILY
public static final java.lang.String UPDATE_POLICY_DAILY
Update locally cached data once a day.- See Also:
- Constant Field Values
-
UPDATE_POLICY_INTERVAL
public static final java.lang.String UPDATE_POLICY_INTERVAL
Update locally cached data every X minutes as given by "interval:X".- See Also:
- Constant Field Values
-
CHECKSUM_POLICY_FAIL
public static final java.lang.String CHECKSUM_POLICY_FAIL
Enforce presence of checksums and fail the resolution if they do not match or are absent.- See Also:
- Constant Field Values
-
CHECKSUM_POLICY_WARN
public static final java.lang.String CHECKSUM_POLICY_WARN
Expect presence of checksums and warn if they do not match or are absent.- See Also:
- Constant Field Values
-
CHECKSUM_POLICY_IGNORE
public static final java.lang.String CHECKSUM_POLICY_IGNORE
Ignore presence and verification of checksums.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
RepositoryPolicy
public RepositoryPolicy()
Creates a new policy with checksum warnings and daily update checks.
-
RepositoryPolicy
public RepositoryPolicy(boolean enabled, java.lang.String updatePolicy, java.lang.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, java.lang.String artifactUpdatePolicy, java.lang.String metadataUpdatePolicy, java.lang.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 benull.metadataUpdatePolicy- The update interval after which locally cached metadata from the repository is considered stale and should be re-fetched, may benull.checksumPolicy- The way checksum verification should be handled, may benull.- Since:
- 2.0.0
-
-
Method Detail
-
isEnabled
public boolean isEnabled()
Indicates whether the associated repository should be contacted or not.- Returns:
trueif the repository should be contacted,falseotherwise.
-
getUpdatePolicy
@Deprecated public java.lang.String 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 invokesgetArtifactUpdatePolicy().This method is not used in Resolver, as resolver internally strictly distinguishes between artifact and metadata update policies.
-
getArtifactUpdatePolicy
public java.lang.String getArtifactUpdatePolicy()
Gets the update policy for locally cached artifacts from the repository.- Returns:
- The update policy, never
null. - Since:
- 2.0.0
-
getMetadataUpdatePolicy
public java.lang.String getMetadataUpdatePolicy()
Gets the update policy for locally cached metadata from the repository.- Returns:
- The update policy, never
null. - Since:
- 2.0.0
-
getChecksumPolicy
public java.lang.String getChecksumPolicy()
Gets the policy for checksum validation.- Returns:
- The checksum policy, never
null.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-