List of utility methods to do Zip Directory
void | zipDirectory(File dir, String zipDirName) zip Directory try { filesListInDir = new ArrayList<String>(); getFilesList(dir); FileOutputStream fos = new FileOutputStream(zipDirName); ZipOutputStream zos = new ZipOutputStream(fos); for (String filePath : filesListInDir) { ZipEntry ze = new ZipEntry( filePath.substring(dir.getAbsolutePath().length() + 1, filePath.length())); ... |
void | zipDirectory(File directory, File zip) zip Directory FileOutputStream fos = new FileOutputStream(zip); ZipOutputStream zos = new ZipOutputStream(fos); zipArchive(directory, directory, zos); zos.close(); fos.close(); |
void | zipDirectory(File directory, File zip) This method converts a directory into a zip file ZipOutputStream zos = new ZipOutputStream(new FileOutputStream(zip)); zip(directory, directory, zos); zos.close(); |
void | zipDirectory(File directory, File zipFile) zip Directory ZipOutputStream out = new ZipOutputStream(new FileOutputStream(zipFile)); addDir(directory, directory, out); out.close(); |
void | zipDirectory(File directory, File zipFile) Zips a directory to a specified file. ZipOutputStream zos = new ZipOutputStream(new FileOutputStream(zipFile)); try { zipDirectory(directory , directory, zos); } finally { zos.close(); |
void | zipDirectory(File directory, File zipFile, Pattern exclusion) Utility method to zip a directory hierarchy recursively into a single compressed file. zipDirectory(directory, zipFile, new byte[BUFFER_SIZE], exclusion); |
void | zipDirectory(File directory, ZipOutputStream zipout, final FilenameFilter filter) Zips up the directory contents into the specified ZipOutputStream . zipDirectory(directory, "", zipout, filter);
|
File | zipDirectory(File dirToZip, File outputDir, String fileName) Zip the content of a directory. if (!dirToZip.exists()) { throw new FileNotFoundException("Directory to zip " + dirToZip.getCanonicalPath() + " does not exist"); if (!outputDir.exists()) { throw new FileNotFoundException("Output directory " + outputDir.getCanonicalPath() + " does not exist"); File zipFile = new File(outputDir, fileName); try (ZipOutputStream zipOutputStream = new ZipOutputStream(new FileOutputStream(zipFile));) { ... |
void | zipDirectory(File folder, File outputFile) zip Directory ZipOutputStream zos = null; try { zos = new ZipOutputStream(new FileOutputStream(outputFile)); zip(folder, folder, zos); zos.close(); } catch (IOException ioException) { throw ioException; } finally { ... |
void | zipDirectory(File inputDirectory, File zipFile) Zip compresses a directory. FileOutputStream dest = new FileOutputStream(zipFile); ZipOutputStream out = new ZipOutputStream(new BufferedOutputStream(dest)); constructZip(inputDirectory, out, ""); out.close(); |