From 98ec212c559da813d9c5687c75dae467e8240c3c Mon Sep 17 00:00:00 2001 From: "Vladimir V. Bychkov" Date: Fri, 5 Apr 2024 15:04:18 +0200 Subject: [PATCH] add access artifact properties through api --- .../src/aQute/p2/api/Artifact.java | 14 ++++++++++++++ .../src/aQute/p2/provider/ArtifactRepository.java | 1 + 2 files changed, 15 insertions(+) diff --git a/biz.aQute.repository/src/aQute/p2/api/Artifact.java b/biz.aQute.repository/src/aQute/p2/api/Artifact.java index 7aefa77509d..0788af11320 100644 --- a/biz.aQute.repository/src/aQute/p2/api/Artifact.java +++ b/biz.aQute.repository/src/aQute/p2/api/Artifact.java @@ -1,6 +1,8 @@ package aQute.p2.api; import java.net.URI; +import java.util.HashMap; +import java.util.Map; import org.osgi.framework.Version; @@ -140,5 +142,17 @@ public class Artifact extends DTO { public String md5; public long download_size; public String format; + private Map properties = new HashMap<>(0); + public void setProperties(Map properties) { + this.properties = properties; + } + + public Map getProperties() { + return properties; + } + + public String getProperty(String name) { + return properties.get(name); + } } diff --git a/biz.aQute.repository/src/aQute/p2/provider/ArtifactRepository.java b/biz.aQute.repository/src/aQute/p2/provider/ArtifactRepository.java index 8305d949ac1..4e7ced5b56e 100644 --- a/biz.aQute.repository/src/aQute/p2/provider/ArtifactRepository.java +++ b/biz.aQute.repository/src/aQute/p2/provider/ArtifactRepository.java @@ -141,6 +141,7 @@ void parse() throws Exception { } catch (NumberFormatException e) { artifact.download_size = -1L; } + artifact.setProperties(artifactProperties); artifacts.add(artifact); break; }