@Singleton @Named(value="sparseDirectory") public final class SparseDirectoryTrustedChecksumsSource extends FileTrustedChecksumsSourceSupport
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".
LocalPathComposer
Modifier and Type | Class and Description |
---|---|
private class |
SparseDirectoryTrustedChecksumsSource.SparseDirectoryWriter |
TrustedChecksumsSource.Writer
Modifier and Type | Field and Description |
---|---|
private FileProcessor |
fileProcessor |
private LocalPathComposer |
localPathComposer |
private static org.slf4j.Logger |
LOGGER |
static java.lang.String |
NAME |
LOCAL_REPO_PREFIX_DIR
Constructor and Description |
---|
SparseDirectoryTrustedChecksumsSource(FileProcessor fileProcessor,
LocalPathComposer localPathComposer) |
Modifier and Type | Method and Description |
---|---|
private java.lang.String |
calculateArtifactPath(boolean originAware,
Artifact artifact,
ArtifactRepository artifactRepository,
ChecksumAlgorithmFactory checksumAlgorithmFactory) |
protected java.util.Map<java.lang.String,java.lang.String> |
doGetTrustedArtifactChecksums(RepositorySystemSession session,
Artifact artifact,
ArtifactRepository artifactRepository,
java.util.List<ChecksumAlgorithmFactory> checksumAlgorithmFactories)
Implementors MUST NOT return
null at this point, as this source is enabled. |
protected SparseDirectoryTrustedChecksumsSource.SparseDirectoryWriter |
doGetTrustedArtifactChecksumsWriter(RepositorySystemSession session)
Implementors may override this method and return
Writer instance. |
configPropKey, getBasedir, getTrustedArtifactChecksums, getTrustedArtifactChecksumsWriter, isEnabled, isOriginAware
public static final java.lang.String NAME
private static final org.slf4j.Logger LOGGER
private final FileProcessor fileProcessor
private final LocalPathComposer localPathComposer
@Inject public SparseDirectoryTrustedChecksumsSource(FileProcessor fileProcessor, LocalPathComposer localPathComposer)
protected java.util.Map<java.lang.String,java.lang.String> doGetTrustedArtifactChecksums(RepositorySystemSession session, Artifact artifact, ArtifactRepository artifactRepository, java.util.List<ChecksumAlgorithmFactory> checksumAlgorithmFactories)
FileTrustedChecksumsSourceSupport
null
at this point, as this source is enabled.doGetTrustedArtifactChecksums
in class FileTrustedChecksumsSourceSupport
protected SparseDirectoryTrustedChecksumsSource.SparseDirectoryWriter doGetTrustedArtifactChecksumsWriter(RepositorySystemSession session)
FileTrustedChecksumsSourceSupport
Writer
instance.doGetTrustedArtifactChecksumsWriter
in class FileTrustedChecksumsSourceSupport
private java.lang.String calculateArtifactPath(boolean originAware, Artifact artifact, ArtifactRepository artifactRepository, ChecksumAlgorithmFactory checksumAlgorithmFactory)