in src/main/java/org/apache/sling/commons/osgi/BundleFileProcessor.java [68:101]
public File process() throws IOException {
JarInputStream jis = null;
try {
jis = new JarInputStream(new FileInputStream(input));
Manifest oldMF = jis.getManifest();
Manifest newMF = processManifest(oldMF);
File newBundle = new File(outputFolder, getTargetFilename(oldMF));
JarOutputStream jos = null;
try {
jos = new JarOutputStream(new FileOutputStream(newBundle), newMF);
JarEntry je = null;
while ((je = jis.getNextJarEntry()) != null) {
try {
jos.putNextEntry(je);
if (!je.isDirectory())
pumpStream(jis, jos);
} finally {
jos.closeEntry();
jis.closeEntry();;
}
}
} finally {
if(jos != null) {
jos.close();
}
}
return newBundle;
} finally {
if(jis != null) {
jis.close();
}
}
}