Package org.eclipse.aether.internal.impl
Class Maven2RepositoryLayoutFactory.Maven2RepositoryLayout
java.lang.Object
org.eclipse.aether.internal.impl.Maven2RepositoryLayoutFactory.Maven2RepositoryLayout
- All Implemented Interfaces:
RepositoryLayout
- Enclosing class:
Maven2RepositoryLayoutFactory
private static class Maven2RepositoryLayoutFactory.Maven2RepositoryLayout
extends Object
implements RepositoryLayout
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.aether.spi.connector.layout.RepositoryLayout
RepositoryLayout.ChecksumLocation
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ChecksumAlgorithmFactorySelector
private final List
<ChecksumAlgorithmFactory> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
Maven2RepositoryLayout
(ChecksumAlgorithmFactorySelector checksumAlgorithmFactorySelector, List<ChecksumAlgorithmFactory> configuredChecksumAlgorithms, Set<String> extensionsWithoutChecksums) -
Method Summary
Modifier and TypeMethodDescriptionReturns immutable list ofChecksumAlgorithmFactory
this instance of layout uses, nevernull
.private List
<RepositoryLayout.ChecksumLocation> getChecksumLocations
(URI location) getChecksumLocations
(Artifact artifact, boolean upload, URI location) Gets the checksums files that a remote repository keeps to help detect data corruption during transfers of the specified artifact.getChecksumLocations
(Metadata metadata, boolean upload, URI location) Gets the checksums files that a remote repository keeps to help detect data corruption during transfers of the specified metadata.getLocation
(Artifact artifact, boolean upload) Gets the location within a remote repository where the specified artifact resides.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
(String extension) private URI
-
Field Details
-
checksumAlgorithmFactorySelector
-
configuredChecksumAlgorithms
-
extensionsWithoutChecksums
-
-
Constructor Details
-
Maven2RepositoryLayout
private Maven2RepositoryLayout(ChecksumAlgorithmFactorySelector checksumAlgorithmFactorySelector, List<ChecksumAlgorithmFactory> configuredChecksumAlgorithms, Set<String> extensionsWithoutChecksums)
-
-
Method Details
-
toUri
-
getChecksumAlgorithmFactories
Description copied from interface:RepositoryLayout
Returns immutable list ofChecksumAlgorithmFactory
this instance of layout uses, nevernull
. The order also represents the order how remote external checksums are retrieved and validated.- Specified by:
getChecksumAlgorithmFactories
in interfaceRepositoryLayout
- See Also:
-
hasChecksums
Description copied from interface:RepositoryLayout
Tells whether given artifact have remote external checksums according to current layout or not. If it returnstrue
, 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 returnsfalse
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. SeeChecksumPolicy.ChecksumKind.REMOTE_EXTERNAL
. On download, theRepositoryLayout.getChecksumAlgorithmFactories()
layout required checksums are calculated, and non layout-provided checksums are still utilized. Typical case to returnfalse
(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.- Specified by:
hasChecksums
in interfaceRepositoryLayout
- See Also:
-
getLocation
Description copied from interface:RepositoryLayout
Gets the location within a remote repository where the specified artifact resides. The URI is relative to the root directory of the repository.- Specified by:
getLocation
in interfaceRepositoryLayout
- Parameters:
artifact
- The artifact to get the URI for, must not benull
.upload
-false
if the artifact is being downloaded,true
if the artifact is being uploaded.- Returns:
- The relative URI to the artifact, never
null
.
-
getLocation
Description copied from interface:RepositoryLayout
Gets the location within a remote repository where the specified metadata resides. The URI is relative to the root directory of the repository.- Specified by:
getLocation
in interfaceRepositoryLayout
- Parameters:
metadata
- The metadata to get the URI for, must not benull
.upload
-false
if the metadata is being downloaded,true
if the metadata is being uploaded.- Returns:
- The relative URI to the metadata, never
null
.
-
getChecksumLocations
public List<RepositoryLayout.ChecksumLocation> getChecksumLocations(Artifact artifact, boolean upload, URI location) Description copied from interface:RepositoryLayout
Gets the checksums files that a remote repository keeps to help detect data corruption during transfers of the specified artifact.- Specified by:
getChecksumLocations
in interfaceRepositoryLayout
- Parameters:
artifact
- The artifact to get the checksum files for, must not benull
.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 fromRepositoryLayout.getLocation(Artifact, boolean)
, must not benull
.- Returns:
- The checksum files for the given artifact, possibly empty but never
null
. If empty, that means that this layout does not provide checksums for given artifact.
-
getChecksumLocations
public List<RepositoryLayout.ChecksumLocation> getChecksumLocations(Metadata metadata, boolean upload, URI location) Description copied from interface:RepositoryLayout
Gets the checksums files that a remote repository keeps to help detect data corruption during transfers of the specified metadata.- Specified by:
getChecksumLocations
in interfaceRepositoryLayout
- Parameters:
metadata
- The metadata to get the checksum files for, must not benull
.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 fromRepositoryLayout.getLocation(Metadata, boolean)
, must not benull
.- Returns:
- The checksum files for the given metadata, possibly empty but never
null
. If empty, that means that this layout does not provide checksums for given artifact.
-
getChecksumLocations
-
isChecksum
-