Skip to content

Commit

Permalink
add access artifact properties through api
Browse files Browse the repository at this point in the history
  • Loading branch information
bvfalcon committed Apr 5, 2024
1 parent 49d68b3 commit 98ec212
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
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);
}
}
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 98ec212

Please sign in to comment.