Skip to content

Commit

Permalink
Merge pull request #6080 from bvfalcon/issue-6062
Browse files Browse the repository at this point in the history
add access artifact properties through api
  • Loading branch information
pkriens authored Apr 22, 2024
2 parents 00bb7db + a9e2bff commit dbcaea6
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
14 changes: 14 additions & 0 deletions biz.aQute.repository/src/aQute/p2/api/Artifact.java
Original file line number Diff line number Diff line change
@@ -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;

Expand Down Expand Up @@ -140,5 +142,17 @@ public class Artifact extends DTO {
public String md5;
public long download_size;
public String format;
private Map<String, String> properties = new HashMap<>(0);

public void setProperties(Map<String, String> properties) {
this.properties = properties;
}

public Map<String, String> getProperties() {
return properties;
}

public String getProperty(String name) {
return properties.get(name);
}
}
2 changes: 1 addition & 1 deletion biz.aQute.repository/src/aQute/p2/api/package-info.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@Version("1.4.0")
@Version("1.5.0")
package aQute.p2.api;

import org.osgi.annotation.versioning.Version;
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ void parse() throws Exception {
} catch (NumberFormatException e) {
artifact.download_size = -1L;
}
artifact.setProperties(artifactProperties);
artifacts.add(artifact);
break;
}
Expand Down

0 comments on commit dbcaea6

Please sign in to comment.