try {
Properties properties = new UTF8Properties();
properties.load(stream);
Parameters params = new Parameters(properties.getProperty("org.osgi.framework.system.packages", ""));
for (String packageName : params.keySet()) {
CapReqBuilder builder = new CapReqBuilder(PackageNamespace.PACKAGE_NAMESPACE);
builder.addAttribute(PackageNamespace.PACKAGE_NAMESPACE, packageName);
builder.addAttribute(PackageNamespace.CAPABILITY_VERSION_ATTRIBUTE, new Version(0, 0, 0));
Capability cap = builder.setResource(framework).buildCapability();
capIndex.addCapability(cap);