BundleContext context = session.getBundleContext();
Map expectedResources = new HashMap();
AbstractInfo[] resourceInfos = (AbstractInfo[]) source.getResourceInfos();
for (int i = 0; i < resourceInfos.length; i++) {
AbstractInfo resourceInfo = resourceInfos[i];
if (!resourceInfo.isMissing()) {
expectedResources.put(resourceInfo.getPath(), resourceInfo);
}
}
try {
String allowForeignCustomerizers = System.getProperty("org.apache.felix.deploymentadmin.allowforeigncustomizers", "false");
while (!expectedResources.isEmpty()) {
AbstractInfo jarEntry = source.getNextEntry();
if (jarEntry == null) {
throw new DeploymentException(DeploymentException.CODE_OTHER_ERROR, "Expected more resources in the stream: " + expectedResources.keySet());
}
String name = jarEntry.getPath();
ResourceInfoImpl resourceInfo = (ResourceInfoImpl) expectedResources.remove(name);
if (resourceInfo == null) {
throw new DeploymentException(DeploymentException.CODE_OTHER_ERROR, "Resource '" + name + "' is not described in the manifest.");
}