Class SparseDirectoryTrustedChecksumsSource
java.lang.Object
org.eclipse.aether.internal.impl.checksum.FileTrustedChecksumsSourceSupport
org.eclipse.aether.internal.impl.checksum.SparseDirectoryTrustedChecksumsSource
- All Implemented Interfaces:
TrustedChecksumsSource
@Singleton
@Named("sparseDirectory")
public final class SparseDirectoryTrustedChecksumsSource
extends FileTrustedChecksumsSourceSupport
Sparse file
FileTrustedChecksumsSourceSupport implementation that use specified directory as base
directory, where it expects artifacts checksums on standard Maven2 "local" layout. This implementation uses Artifact
coordinates solely to form path from basedir, pretty much as Maven local repository does. Metadata checksums are
covered as well, on the same layout, with the metadata path composed from the origin repository key (for example
g/a/v/maven-metadata-central.xml.sha1).
The source by default is "origin aware", it will factor in origin repository ID as well into base directory name (for example ".checksums/central/...").
The checksums files are directly loaded from disk, so in-flight file changes during lifecycle of session are picked up. This implementation can be simultaneously used to lookup and also write checksums. The written checksums will become visible across all sessions right after the moment they were written.
The name of this implementation is "sparseDirectory".
- Since:
- 1.9.0
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.aether.spi.checksums.TrustedChecksumsSource
TrustedChecksumsSource.Writer -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe basedir where checksums are.static final StringIs checksum source enabled?static final StringIs source origin aware?static final Stringstatic final StringFields inherited from class org.eclipse.aether.internal.impl.checksum.FileTrustedChecksumsSourceSupport
logger -
Constructor Summary
ConstructorsConstructorDescriptionSparseDirectoryTrustedChecksumsSource(RepositoryKeyFunctionFactory repositoryKeyFunctionFactory, ChecksumProcessor checksumProcessor, LocalPathComposer localPathComposer) -
Method Summary
Modifier and TypeMethodDescriptiondoGetTrustedArtifactChecksums(RepositorySystemSession session, Artifact artifact, ArtifactRepository artifactRepository, List<ChecksumAlgorithmFactory> checksumAlgorithmFactories) Implementors MUST NOT returnnullat this point, as this source is enabled.protected TrustedChecksumsSource.WriterImplementors may override this method and returnTrustedChecksumsSource.Writerinstance.doGetTrustedMetadataChecksums(RepositorySystemSession session, Metadata metadata, ArtifactRepository artifactRepository, List<ChecksumAlgorithmFactory> checksumAlgorithmFactories) Implementors MUST NOT returnnullat this point, as this source is enabled.protected booleanisEnabled(RepositorySystemSession session) Returnstrueif session configuration marks this instance as enabled.Methods inherited from class org.eclipse.aether.internal.impl.checksum.FileTrustedChecksumsSourceSupport
getBasedir, getTrustedArtifactChecksums, getTrustedArtifactChecksumsWriter, getTrustedMetadataChecksums, repositoryKey
-
Field Details
-
NAME
- See Also:
-
CONFIG_PROP_ENABLED
Is checksum source enabled?- See Also:
- Sourced from:
RepositorySystemSession.getConfigProperties()- Value type:
Boolean- Default value:
- false
-
CONFIG_PROP_BASEDIR
The basedir where checksums are. If relative, is resolved from local repository root.- See Also:
- Sourced from:
RepositorySystemSession.getConfigProperties()- Value type:
String- Default value:
LOCAL_REPO_PREFIX_DIR
-
LOCAL_REPO_PREFIX_DIR
- See Also:
-
CONFIG_PROP_ORIGIN_AWARE
Is source origin aware?- See Also:
- Sourced from:
RepositorySystemSession.getConfigProperties()- Value type:
Boolean- Default value:
- true
-
-
Constructor Details
-
SparseDirectoryTrustedChecksumsSource
@Inject public SparseDirectoryTrustedChecksumsSource(RepositoryKeyFunctionFactory repositoryKeyFunctionFactory, ChecksumProcessor checksumProcessor, LocalPathComposer localPathComposer)
-
-
Method Details
-
isEnabled
Description copied from class:FileTrustedChecksumsSourceSupportReturnstrueif session configuration marks this instance as enabled.Default value is
false.- Specified by:
isEnabledin classFileTrustedChecksumsSourceSupport
-
doGetTrustedArtifactChecksums
protected Map<String,String> doGetTrustedArtifactChecksums(RepositorySystemSession session, Artifact artifact, ArtifactRepository artifactRepository, List<ChecksumAlgorithmFactory> checksumAlgorithmFactories) Description copied from class:FileTrustedChecksumsSourceSupportImplementors MUST NOT returnnullat this point, as this source is enabled.- Specified by:
doGetTrustedArtifactChecksumsin classFileTrustedChecksumsSourceSupport
-
doGetTrustedMetadataChecksums
protected Map<String,String> doGetTrustedMetadataChecksums(RepositorySystemSession session, Metadata metadata, ArtifactRepository artifactRepository, List<ChecksumAlgorithmFactory> checksumAlgorithmFactories) Description copied from class:FileTrustedChecksumsSourceSupportImplementors MUST NOT returnnullat this point, as this source is enabled. Metadata checksums are looked up using the same file conventions as artifact checksums, with the metadata path composed from the origin repository key (for exampleg/a/v/maven-metadata-central.xml).- Specified by:
doGetTrustedMetadataChecksumsin classFileTrustedChecksumsSourceSupport
-
doGetTrustedArtifactChecksumsWriter
protected TrustedChecksumsSource.Writer doGetTrustedArtifactChecksumsWriter(RepositorySystemSession session) Description copied from class:FileTrustedChecksumsSourceSupportImplementors may override this method and returnTrustedChecksumsSource.Writerinstance.- Overrides:
doGetTrustedArtifactChecksumsWriterin classFileTrustedChecksumsSourceSupport
-