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.
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 ClassesModifier and TypeClassDescriptionprivate classNested classes/interfaces inherited from interface org.eclipse.aether.spi.checksums.TrustedChecksumsSource
TrustedChecksumsSource.Writer -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final FileProcessorprivate final LocalPathComposerprivate static final org.slf4j.Loggerstatic final StringFields inherited from class org.eclipse.aether.internal.impl.checksum.FileTrustedChecksumsSourceSupport
LOCAL_REPO_PREFIX_DIR -
Constructor Summary
ConstructorsConstructorDescriptionSparseDirectoryTrustedChecksumsSource(FileProcessor fileProcessor, LocalPathComposer localPathComposer) -
Method Summary
Modifier and TypeMethodDescriptionprivate StringcalculateArtifactPath(boolean originAware, Artifact artifact, ArtifactRepository artifactRepository, ChecksumAlgorithmFactory checksumAlgorithmFactory) doGetTrustedArtifactChecksums(RepositorySystemSession session, Artifact artifact, ArtifactRepository artifactRepository, List<ChecksumAlgorithmFactory> checksumAlgorithmFactories) Implementors MUST NOT returnnullat this point, as this source is enabled.Implementors may override this method and returnTrustedChecksumsSource.Writerinstance.Methods inherited from class org.eclipse.aether.internal.impl.checksum.FileTrustedChecksumsSourceSupport
configPropKey, getBasedir, getTrustedArtifactChecksums, getTrustedArtifactChecksumsWriter, isEnabled, isOriginAware
-
Field Details
-
NAME
- See Also:
-
LOGGER
private static final org.slf4j.Logger LOGGER -
fileProcessor
-
localPathComposer
-
-
Constructor Details
-
SparseDirectoryTrustedChecksumsSource
@Inject public SparseDirectoryTrustedChecksumsSource(FileProcessor fileProcessor, LocalPathComposer localPathComposer)
-
-
Method Details
-
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
-
doGetTrustedArtifactChecksumsWriter
protected SparseDirectoryTrustedChecksumsSource.SparseDirectoryWriter doGetTrustedArtifactChecksumsWriter(RepositorySystemSession session) Description copied from class:FileTrustedChecksumsSourceSupportImplementors may override this method and returnTrustedChecksumsSource.Writerinstance.- Overrides:
doGetTrustedArtifactChecksumsWriterin classFileTrustedChecksumsSourceSupport
-
calculateArtifactPath
private String calculateArtifactPath(boolean originAware, Artifact artifact, ArtifactRepository artifactRepository, ChecksumAlgorithmFactory checksumAlgorithmFactory)
-