Class SparseDirectoryTrustedChecksumsSource
- java.lang.Object
-
- org.eclipse.aether.internal.impl.checksum.FileTrustedChecksumsSourceSupport
-
- org.eclipse.aether.internal.impl.checksum.SparseDirectoryTrustedChecksumsSource
-
- All Implemented Interfaces:
org.eclipse.aether.spi.checksums.TrustedChecksumsSource
@Singleton @Named("sparseDirectory") public final class SparseDirectoryTrustedChecksumsSource extends FileTrustedChecksumsSourceSupportSparse fileFileTrustedChecksumsSourceSupportimplementation 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:
LocalPathComposer
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCONFIG_PROP_BASEDIRThe basedir where checksums are.static java.lang.StringCONFIG_PROP_ENABLEDIs checksum source enabled?static java.lang.StringCONFIG_PROP_ORIGIN_AWAREIs source origin aware?static java.lang.StringLOCAL_REPO_PREFIX_DIRstatic java.lang.StringNAME-
Fields inherited from class org.eclipse.aether.internal.impl.checksum.FileTrustedChecksumsSourceSupport
CONFIG_PROP_REPOSITORY_KEY_FUNCTION, DEFAULT_REPOSITORY_KEY_FUNCTION
-
-
Constructor Summary
Constructors Constructor Description SparseDirectoryTrustedChecksumsSource(org.eclipse.aether.spi.remoterepo.RepositoryKeyFunctionFactory repositoryKeyFunctionFactory, org.eclipse.aether.spi.io.ChecksumProcessor checksumProcessor, LocalPathComposer localPathComposer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.Map<java.lang.String,java.lang.String>doGetTrustedArtifactChecksums(org.eclipse.aether.RepositorySystemSession session, org.eclipse.aether.artifact.Artifact artifact, org.eclipse.aether.repository.ArtifactRepository artifactRepository, java.util.List<org.eclipse.aether.spi.connector.checksum.ChecksumAlgorithmFactory> checksumAlgorithmFactories)Implementors MUST NOT returnnullat this point, as this source is enabled.protected org.eclipse.aether.spi.checksums.TrustedChecksumsSource.WriterdoGetTrustedArtifactChecksumsWriter(org.eclipse.aether.RepositorySystemSession session)Implementors may override this method and returnTrustedChecksumsSource.Writerinstance.protected booleanisEnabled(org.eclipse.aether.RepositorySystemSession session)Returnstrueif session configuration marks this instance as enabled.-
Methods inherited from class org.eclipse.aether.internal.impl.checksum.FileTrustedChecksumsSourceSupport
getBasedir, getTrustedArtifactChecksums, getTrustedArtifactChecksumsWriter, repositoryKey
-
-
-
-
Field Detail
-
NAME
public static final java.lang.String NAME
- See Also:
- Constant Field Values
-
CONFIG_PROP_ENABLED
public static final java.lang.String CONFIG_PROP_ENABLED
Is checksum source enabled?- See Also:
- Constant Field Values
-
CONFIG_PROP_BASEDIR
public static final java.lang.String CONFIG_PROP_BASEDIR
The basedir where checksums are. If relative, is resolved from local repository root.- See Also:
- Constant Field Values
-
LOCAL_REPO_PREFIX_DIR
public static final java.lang.String LOCAL_REPO_PREFIX_DIR
- See Also:
- Constant Field Values
-
CONFIG_PROP_ORIGIN_AWARE
public static final java.lang.String CONFIG_PROP_ORIGIN_AWARE
Is source origin aware?- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SparseDirectoryTrustedChecksumsSource
@Inject public SparseDirectoryTrustedChecksumsSource(org.eclipse.aether.spi.remoterepo.RepositoryKeyFunctionFactory repositoryKeyFunctionFactory, org.eclipse.aether.spi.io.ChecksumProcessor checksumProcessor, LocalPathComposer localPathComposer)
-
-
Method Detail
-
isEnabled
protected boolean isEnabled(org.eclipse.aether.RepositorySystemSession session)
Description copied from class:FileTrustedChecksumsSourceSupportReturnstrueif session configuration marks this instance as enabled.Default value is
false.- Specified by:
isEnabledin classFileTrustedChecksumsSourceSupport
-
doGetTrustedArtifactChecksums
protected java.util.Map<java.lang.String,java.lang.String> doGetTrustedArtifactChecksums(org.eclipse.aether.RepositorySystemSession session, org.eclipse.aether.artifact.Artifact artifact, org.eclipse.aether.repository.ArtifactRepository artifactRepository, java.util.List<org.eclipse.aether.spi.connector.checksum.ChecksumAlgorithmFactory> checksumAlgorithmFactories)
Description copied from class:FileTrustedChecksumsSourceSupportImplementors MUST NOT returnnullat this point, as this source is enabled.- Specified by:
doGetTrustedArtifactChecksumsin classFileTrustedChecksumsSourceSupport
-
doGetTrustedArtifactChecksumsWriter
protected org.eclipse.aether.spi.checksums.TrustedChecksumsSource.Writer doGetTrustedArtifactChecksumsWriter(org.eclipse.aether.RepositorySystemSession session)
Description copied from class:FileTrustedChecksumsSourceSupportImplementors may override this method and returnTrustedChecksumsSource.Writerinstance.- Overrides:
doGetTrustedArtifactChecksumsWriterin classFileTrustedChecksumsSourceSupport
-
-