From 154875818ca9f00abb860354a98c07cd05148e28 Mon Sep 17 00:00:00 2001 From: Sebastian Firsching Date: Tue, 20 Jun 2023 07:58:04 +0200 Subject: [PATCH] Add all artifactUrls to the Mgmt API response Signed-off-by: Sebastian Firsching --- .../hawkbit/mgmt/rest/resource/MgmtSoftwareModuleMapper.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hawkbit-rest/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleMapper.java b/hawkbit-rest/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleMapper.java index 0683d0793..7fdc9f2fa 100644 --- a/hawkbit-rest/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleMapper.java +++ b/hawkbit-rest/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleMapper.java @@ -164,12 +164,12 @@ public final class MgmtSoftwareModuleMapper { static void addLinks(final Artifact artifact, final MgmtArtifact response, final ArtifactUrlHandler artifactUrlHandler, final SystemManagement systemManagement) { - List urls = artifactUrlHandler.getUrls( + final List 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 artifactsToResponse(final Collection artifacts) {