Interface RepositoryLayout
-
public interface RepositoryLayout
The layout for a remote repository whose artifacts/metadata can be addressed via URIs.Note: Implementations must be stateless.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classRepositoryLayout.ChecksumLocationA descriptor for a checksum location.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.List<ChecksumAlgorithmFactory>getChecksumAlgorithmFactories()Returns immutable list ofChecksumAlgorithmFactorythis instance of layout uses, nevernull.java.util.List<RepositoryLayout.ChecksumLocation>getChecksumLocations(org.eclipse.aether.artifact.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(org.eclipse.aether.metadata.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.java.net.URIgetLocation(org.eclipse.aether.artifact.Artifact artifact, boolean upload)Gets the location within a remote repository where the specified artifact resides.java.net.URIgetLocation(org.eclipse.aether.metadata.Metadata metadata, boolean upload)Gets the location within a remote repository where the specified metadata resides.booleanhasChecksums(org.eclipse.aether.artifact.Artifact artifact)Tells whether given artifact have remote external checksums according to current layout or not.
-
-
-
Method Detail
-
getChecksumAlgorithmFactories
java.util.List<ChecksumAlgorithmFactory> getChecksumAlgorithmFactories()
Returns immutable list ofChecksumAlgorithmFactorythis instance of layout uses, nevernull. The order also represents the order how remote external checksums are retrieved and validated.- Since:
- 1.8.0
- See Also:
ChecksumPolicy.ChecksumKind
-
hasChecksums
boolean hasChecksums(org.eclipse.aether.artifact.Artifact artifact)
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 returnsfalsethe 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, thegetChecksumAlgorithmFactories()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.- Since:
- 1.8.0
- See Also:
ChecksumPolicy.ChecksumKind,getChecksumAlgorithmFactories()
-
getLocation
java.net.URI getLocation(org.eclipse.aether.artifact.Artifact artifact, boolean upload)
Gets the location within a remote repository where the specified artifact resides. The URI is relative to the root directory of the repository.- Parameters:
artifact- The artifact to get the URI for, must not benull.upload-falseif the artifact is being downloaded,trueif the artifact is being uploaded.- Returns:
- The relative URI to the artifact, never
null.
-
getLocation
java.net.URI getLocation(org.eclipse.aether.metadata.Metadata metadata, boolean upload)
Gets the location within a remote repository where the specified metadata resides. The URI is relative to the root directory of the repository.- Parameters:
metadata- The metadata to get the URI for, must not benull.upload-falseif the metadata is being downloaded,trueif the metadata is being uploaded.- Returns:
- The relative URI to the metadata, never
null.
-
getChecksumLocations
java.util.List<RepositoryLayout.ChecksumLocation> getChecksumLocations(org.eclipse.aether.artifact.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.- Parameters:
artifact- The artifact to get the checksum files for, must not benull.upload-falseif the checksums are being downloaded/verified,trueif the checksums are being uploaded/created.location- The relative URI to the artifact within the repository as previously obtained fromgetLocation(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
java.util.List<RepositoryLayout.ChecksumLocation> getChecksumLocations(org.eclipse.aether.metadata.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.- Parameters:
metadata- The metadata to get the checksum files for, must not benull.upload-falseif the checksums are being downloaded/verified,trueif the checksums are being uploaded/created.location- The relative URI to the metadata within the repository as previously obtained fromgetLocation(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.
-
-