private static class Maven2RepositoryLayoutFactory.Maven2RepositoryLayout extends java.lang.Object implements RepositoryLayout
RepositoryLayout.ChecksumLocation
Modifier and Type | Field and Description |
---|---|
private ChecksumAlgorithmFactorySelector |
checksumAlgorithmFactorySelector |
private java.util.List<ChecksumAlgorithmFactory> |
configuredChecksumAlgorithms |
private java.util.Set<java.lang.String> |
extensionsWithoutChecksums |
Modifier | Constructor and Description |
---|---|
private |
Maven2RepositoryLayout(ChecksumAlgorithmFactorySelector checksumAlgorithmFactorySelector,
java.util.List<ChecksumAlgorithmFactory> configuredChecksumAlgorithms,
java.util.Set<java.lang.String> extensionsWithoutChecksums) |
Modifier and Type | Method and Description |
---|---|
java.util.List<ChecksumAlgorithmFactory> |
getChecksumAlgorithmFactories()
Returns immutable list of
ChecksumAlgorithmFactory this instance of layout uses, never null . |
java.util.List<RepositoryLayout.ChecksumLocation> |
getChecksumLocations(Artifact artifact,
boolean upload,
java.net.URI location)
Gets the checksums files that a remote repository keeps to help detect data corruption during transfers of the
specified artifact.
|
java.util.List<RepositoryLayout.ChecksumLocation> |
getChecksumLocations(Metadata metadata,
boolean upload,
java.net.URI location)
Gets the checksums files that a remote repository keeps to help detect data corruption during transfers of the
specified metadata.
|
private java.util.List<RepositoryLayout.ChecksumLocation> |
getChecksumLocations(java.net.URI location) |
java.net.URI |
getLocation(Artifact artifact,
boolean upload)
Gets the location within a remote repository where the specified artifact resides.
|
java.net.URI |
getLocation(Metadata metadata,
boolean upload)
Gets the location within a remote repository where the specified metadata resides.
|
boolean |
hasChecksums(Artifact artifact)
Tells whether given artifact have remote external checksums according to current layout or not.
|
private boolean |
isChecksum(java.lang.String extension) |
private java.net.URI |
toUri(java.lang.String path) |
private final ChecksumAlgorithmFactorySelector checksumAlgorithmFactorySelector
private final java.util.List<ChecksumAlgorithmFactory> configuredChecksumAlgorithms
private final java.util.Set<java.lang.String> extensionsWithoutChecksums
private Maven2RepositoryLayout(ChecksumAlgorithmFactorySelector checksumAlgorithmFactorySelector, java.util.List<ChecksumAlgorithmFactory> configuredChecksumAlgorithms, java.util.Set<java.lang.String> extensionsWithoutChecksums)
private java.net.URI toUri(java.lang.String path)
public java.util.List<ChecksumAlgorithmFactory> getChecksumAlgorithmFactories()
RepositoryLayout
ChecksumAlgorithmFactory
this instance of layout uses, never null
.
The order also represents the order how remote external checksums are retrieved and validated.getChecksumAlgorithmFactories
in interface RepositoryLayout
ChecksumPolicy.ChecksumKind
public boolean hasChecksums(Artifact artifact)
RepositoryLayout
true
, then layout configured checksums will be expected: on upload they will be calculated and deployed
along artifact, on download they will be retrieved and validated.
If it returns false
the given artifacts will have checksums omitted: on upload they will not be
calculated and deployed, and on download they will be not retrieved nor validated.
The result affects only layout provided checksums. See
ChecksumPolicy.ChecksumKind.REMOTE_EXTERNAL
.
On download, the RepositoryLayout.getChecksumAlgorithmFactories()
layout required checksums are calculated, and non layout-provided checksums are still utilized.
Typical case to return false
(to omit checksums) is for artifact signatures, that are already a
"sub-artifact" of some main artifact (for example a JAR), and they can be validated by some other means.hasChecksums
in interface RepositoryLayout
ChecksumPolicy.ChecksumKind
,
RepositoryLayout.getChecksumAlgorithmFactories()
public java.net.URI getLocation(Artifact artifact, boolean upload)
RepositoryLayout
getLocation
in interface RepositoryLayout
artifact
- The artifact to get the URI for, must not be null
.upload
- false
if the artifact is being downloaded, true
if the artifact is being
uploaded.null
.public java.net.URI getLocation(Metadata metadata, boolean upload)
RepositoryLayout
getLocation
in interface RepositoryLayout
metadata
- The metadata to get the URI for, must not be null
.upload
- false
if the metadata is being downloaded, true
if the metadata is being
uploaded.null
.public java.util.List<RepositoryLayout.ChecksumLocation> getChecksumLocations(Artifact artifact, boolean upload, java.net.URI location)
RepositoryLayout
getChecksumLocations
in interface RepositoryLayout
artifact
- The artifact to get the checksum files for, must not be null
.upload
- false
if the checksums are being downloaded/verified, true
if the checksums are
being uploaded/created.location
- The relative URI to the artifact within the repository as previously obtained from
RepositoryLayout.getLocation(Artifact, boolean)
, must not be null
.null
. If empty, that means
that this layout does not provide checksums for given artifact.public java.util.List<RepositoryLayout.ChecksumLocation> getChecksumLocations(Metadata metadata, boolean upload, java.net.URI location)
RepositoryLayout
getChecksumLocations
in interface RepositoryLayout
metadata
- The metadata to get the checksum files for, must not be null
.upload
- false
if the checksums are being downloaded/verified, true
if the checksums are
being uploaded/created.location
- The relative URI to the metadata within the repository as previously obtained from
RepositoryLayout.getLocation(Metadata, boolean)
, must not be null
.null
. If empty, that means
that this layout does not provide checksums for given artifact.private java.util.List<RepositoryLayout.ChecksumLocation> getChecksumLocations(java.net.URI location)
private boolean isChecksum(java.lang.String extension)