List of utility methods to do Zip Directory
void | zipDirectoryEntry(ZipOutputStream output, IPath entry, long time, Set zip Directory Entry entry = entry.addTrailingSeparator(); if (!directoryEntries.contains(entry)) { if (entry.segmentCount() > 1) zipDirectoryEntry(output, entry.removeLastSegments(1), time, directoryEntries); try { ZipEntry dirEntry = new ZipEntry(entry.toString()); dirEntry.setTime(time); output.putNextEntry(dirEntry); ... |
void | zipDirectoryRecursive(File directory, String zipPath, ZipOutputStream zos, ArrayList zip Directory Recursive try { System.out.println(directory.getAbsolutePath() + "::" + zipPath); String[] dirList = directory.list(); byte[] readBuffer = new byte[2156]; int bytesIn = 0; for (int i = 0; i < dirList.length; i++) { File f = new File(directory, dirList[i]); System.err.println("avoiding: " + avoidingFiles); ... |
void | zipSubDirectory(String basePath, File dir, ZipOutputStream zout) zip Sub Directory byte[] buffer = new byte[4096]; File[] files = dir.listFiles(); for (File file : files) { if (file.isDirectory()) { String path = basePath + file.getName() + "/"; zout.putNextEntry(new ZipEntry(path)); zipSubDirectory(path, file, zout); zout.closeEntry(); ... |