use of org.apache.aries.subsystem.core.archive.SubsystemContentHeader.Clause in project aries by apache.
the class RawSubsystemResource method computeFileCapabilities.
private List<Capability> computeFileCapabilities(FileResource resource, IFile file, SubsystemManifest manifest) {
SubsystemContentHeader ssch = manifest.getSubsystemContentHeader();
if (ssch == null)
return Collections.emptyList();
for (Clause c : ssch.getClauses()) {
Attribute er = c.getAttribute(ContentHandler.EMBEDDED_RESOURCE_ATTRIBUTE);
if (er != null) {
if (file.getName().equals(er.getValue())) {
Map<String, Object> attrs = new HashMap<String, Object>();
attrs.put(ContentHandler.EMBEDDED_RESOURCE_ATTRIBUTE, er.getValue());
return Collections.<Capability>singletonList(new OsgiIdentityCapability(resource, c.getSymbolicName(), c.getVersionRange().getLeft(), c.getType(), attrs));
}
}
}
return Collections.emptyList();
}
Aggregations