use of org.apache.archiva.rest.api.model.Entry in project archiva by apache.
the class DefaultBrowseService method getMetadatas.
@Override
public List<Entry> getMetadatas(String groupId, String artifactId, String version, String repositoryId) throws ArchivaRestServiceException {
ProjectVersionMetadata projectVersionMetadata = getProjectMetadata(groupId, artifactId, version, repositoryId);
if (projectVersionMetadata == null) {
return Collections.emptyList();
}
MetadataFacet metadataFacet = projectVersionMetadata.getFacet(GenericMetadataFacet.FACET_ID);
if (metadataFacet == null) {
return Collections.emptyList();
}
Map<String, String> map = metadataFacet.toProperties();
List<Entry> entries = new ArrayList<>(map.size());
for (Map.Entry<String, String> entry : map.entrySet()) {
entries.add(new Entry(entry.getKey(), entry.getValue()));
}
return entries;
}
Aggregations