Class TrustedToProvidedChecksumsSourceAdapter
java.lang.Object
org.eclipse.aether.internal.impl.checksum.TrustedToProvidedChecksumsSourceAdapter
- All Implemented Interfaces:
ProvidedChecksumsSource
@Singleton
@Named("trusted2provided")
public final class TrustedToProvidedChecksumsSourceAdapter
extends Object
implements ProvidedChecksumsSource
Adapter that adapts
TrustedChecksumsSource
to ProvidedChecksumsSource
used by connector. Hence, any
"trusted" source exist that is enabled, automatically becomes "provided" source as well.- Since:
- 1.9.0
-
Field Summary
-
Constructor Summary
ConstructorDescriptionTrustedToProvidedChecksumsSourceAdapter
(Map<String, TrustedChecksumsSource> trustedChecksumsSources) -
Method Summary
Modifier and TypeMethodDescriptiongetProvidedArtifactChecksums
(RepositorySystemSession session, ArtifactDownload transfer, RemoteRepository repository, List<ChecksumAlgorithmFactory> checksumAlgorithmFactories) May return the provided checksums (for given artifact transfer) from source other than remote repository, ornull
if it have no checksums available for given transfer.
-
Field Details
-
NAME
- See Also:
-
-
Constructor Details
-
TrustedToProvidedChecksumsSourceAdapter
@Inject public TrustedToProvidedChecksumsSourceAdapter(Map<String, TrustedChecksumsSource> trustedChecksumsSources)
-
-
Method Details
-
getProvidedArtifactChecksums
public Map<String,String> getProvidedArtifactChecksums(RepositorySystemSession session, ArtifactDownload transfer, RemoteRepository repository, List<ChecksumAlgorithmFactory> checksumAlgorithmFactories) Description copied from interface:ProvidedChecksumsSource
May return the provided checksums (for given artifact transfer) from source other than remote repository, ornull
if it have no checksums available for given transfer. Provided checksums are "opt-in" for transfer, in a way IF they are available upfront, they will be enforced according to checksum policy in effect. Otherwise, provided checksum verification is completely left out.For enabled provided checksum source is completely acceptable to return
null
values, as that carries the meaning "nothing to add here", as there are no checksums to be provided upfront transfer. Semantically, this is equivalent to returning empty map, but signals the intent better.- Specified by:
getProvidedArtifactChecksums
in interfaceProvidedChecksumsSource
- Parameters:
session
- The current session.transfer
- The transfer that is about to be executed.repository
- The remote repository connector is about to contact.checksumAlgorithmFactories
- The checksum algorithms that are expected.- Returns:
- Map of expected checksums, or
null
.
-