}
public List<Capability> getCapabilities(String namespace) {
namespace = NamespaceTranslator.translate(namespace);
if (namespace == null || namespace.equals(IdentityNamespace.IDENTITY_NAMESPACE)) {
Capability c = new OsgiIdentityCapability(this, resource.getSymbolicName(), resource.getVersion());
return Collections.singletonList(c);
}
// TODO Add to constants.
if (namespace.equals("osgi.content")) {
Capability c = new OsgiContentCapability(this, resource.getURI());
return Collections.singletonList(c);
}
org.apache.felix.bundlerepository.Capability[] capabilities = resource.getCapabilities();
ArrayList<Capability> result = new ArrayList<Capability>(capabilities.length);
for (org.apache.felix.bundlerepository.Capability capability : capabilities) {