IOHelper.copyAndCloseInput(is, fos);
} finally {
IOHelper.close(is, fos);
}
BundleDescriptor answer = null;
FileInputStream fis = null;
JarInputStream jis = null;
try {
fis = new FileInputStream(file);
jis = new JarInputStream(fis);
Map<String, String> headers = new HashMap<String, String>();
for (Map.Entry<Object, Object> entry : jis.getManifest().getMainAttributes().entrySet()) {
headers.put(entry.getKey().toString(), entry.getValue().toString());
}
answer = new BundleDescriptor(
bundle.getClass().getClassLoader(),
new URL("jar:" + file.toURI().toString() + "!/"),
headers);
} finally {
IOHelper.close(jis, fis);