Package org.eclipse.aether.repository
Class RepositoryPolicy
java.lang.Object
org.eclipse.aether.repository.RepositoryPolicy
A policy controlling access to a repository.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Verify checksums and fail the resolution if they do not match.static final String
Do not verify checksums.static final String
Verify checksums and warn if they do not match.static final String
Always update locally cached data.static final String
Update locally cached data once a day.static final String
Update locally cached data every X minutes as given by "interval:X".static final String
Never update locally cached data. -
Constructor Summary
ConstructorDescriptionCreates a new policy with checksum warnings and daily update checks.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
(boolean enabled, String artifactUpdatePolicy, String metadataUpdatePolicy, String checksumPolicy) Creates a new policy with the specified settings. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Gets the update policy for locally cached artifacts from the repository.Gets the policy for checksum validation.Gets the update policy for locally cached metadata from the repository.Deprecated.This method should not be used.int
hashCode()
boolean
Indicates whether the associated repository should be contacted or not.toString()
-
Field Details
-
UPDATE_POLICY_NEVER
Never update locally cached data.- See Also:
-
UPDATE_POLICY_ALWAYS
Always update locally cached data.- See Also:
-
UPDATE_POLICY_DAILY
Update locally cached data once a day.- See Also:
-
UPDATE_POLICY_INTERVAL
Update locally cached data every X minutes as given by "interval:X".- See Also:
-
CHECKSUM_POLICY_FAIL
Verify checksums and fail the resolution if they do not match.- See Also:
-
CHECKSUM_POLICY_WARN
Verify checksums and warn if they do not match.- See Also:
-
CHECKSUM_POLICY_IGNORE
Do not verify checksums.- See Also:
-
-
Constructor Details
-
RepositoryPolicy
public RepositoryPolicy()Creates a new policy with checksum warnings and daily update checks. -
RepositoryPolicy
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 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 Details
-
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 invokesgetArtifactUpdatePolicy()
.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
-
equals
-
hashCode
-