Class SparseDirectoryTrustedChecksumsSource

  • All Implemented Interfaces:
    org.eclipse.aether.spi.checksums.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:
    LocalPathComposer
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface org.eclipse.aether.spi.checksums.TrustedChecksumsSource

        org.eclipse.aether.spi.checksums.TrustedChecksumsSource.Writer
    • 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 return null at this point, as this source is enabled.
      protected org.eclipse.aether.spi.checksums.TrustedChecksumsSource.Writer doGetTrustedArtifactChecksumsWriter​(org.eclipse.aether.RepositorySystemSession session)
      Implementors may override this method and return TrustedChecksumsSource.Writer instance.
      protected java.util.Map<java.lang.String,​java.lang.String> doGetTrustedMetadataChecksums​(org.eclipse.aether.RepositorySystemSession session, org.eclipse.aether.metadata.Metadata metadata, org.eclipse.aether.repository.ArtifactRepository artifactRepository, java.util.List<org.eclipse.aether.spi.connector.checksum.ChecksumAlgorithmFactory> checksumAlgorithmFactories)
      Implementors MUST NOT return null at this point, as this source is enabled.
      protected boolean isEnabled​(org.eclipse.aether.RepositorySystemSession session)
      Returns true if session configuration marks this instance as enabled.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait