Add all artifactUrls to the Mgmt API response

Signed-off-by: Sebastian Firsching <sebastian.firsching@bosch-si.com>
This commit is contained in:
Sebastian Firsching
2023-06-20 07:58:04 +02:00
parent 80c471cf80
commit 154875818c

View File

@@ -164,12 +164,12 @@ public final class MgmtSoftwareModuleMapper {
static void addLinks(final Artifact artifact, final MgmtArtifact response,
final ArtifactUrlHandler artifactUrlHandler, final SystemManagement systemManagement) {
List<ArtifactUrl> urls = artifactUrlHandler.getUrls(
final List<ArtifactUrl> urls = artifactUrlHandler.getUrls(
new URLPlaceholder(systemManagement.getTenantMetadata().getTenant(),
systemManagement.getTenantMetadata().getId(), null, null,
new URLPlaceholder.SoftwareData(artifact.getSoftwareModule().getId(), artifact.getFilename(),
artifact.getId(), artifact.getSha1Hash())), ApiType.MGMT, null);
response.add(Link.of(urls.get(0).getRef()).withRel("download").expand());
urls.forEach(entry -> response.add(Link.of(entry.getRef()).withRel(entry.getRel()).expand()));
}
static List<MgmtArtifact> artifactsToResponse(final Collection<Artifact> artifacts) {