private static void zipFolder(String srcFolder, OutputStream outputStream, Closer closer) throws Exception { ZipOutputStream zip = null; /* * create the output stream to zip file result */ zip = closer.register(new ZipOutputStream(outputStream)); /* * add the folder to the zip */ addFolderToZip("", srcFolder, zip); } }
addFolderToZip(path, srcFile, zip); } else {