metaInf.addChild().from(new Callable<FileTreeAdapter>() {
public FileTreeAdapter call() throws Exception {
MapFileTree manifestSource = new MapFileTree(getTemporaryDirFactory(), getFileSystem());
manifestSource.add("MANIFEST.MF", new Action<OutputStream>() {
public void execute(OutputStream outputStream) {
Manifest manifest = getManifest();
if (manifest == null) {
manifest = new DefaultManifest(null);
}
manifest.writeTo(new OutputStreamWriter(outputStream));
}
});
return new FileTreeAdapter(manifestSource);
}