List of utility methods to do Unzip to Folder
void | unzip(String sourceFile, String destDir) unzip BufferedOutputStream dest = null; FileInputStream fis = new FileInputStream(sourceFile); ZipInputStream zis = new ZipInputStream(new BufferedInputStream(fis)); ZipEntry entry = null; int BUFFER_SIZE = 4096; while ((entry = zis.getNextEntry()) != null) { String dst = destDir + File.separator + entry.getName(); if (entry.isDirectory()) { ... |
void | unzip(String sourceFile, String destDir) unzip final FileInputStream fis = new FileInputStream(sourceFile); final ZipInputStream zis = new ZipInputStream(new BufferedInputStream(fis)); final File destDirFile = new File(destDir); final byte[] data = new byte[BUFFER_SIZE]; ZipEntry entry; Set<String> visitedDirs = new HashSet<>(); createDir(destDir); while ((entry = zis.getNextEntry()) != null) { ... |
void | unzip(String sourceFile, String toDir) unzip ZipFile zipFile = new ZipFile(sourceFile); Enumeration<? extends ZipEntry> entries = zipFile.entries(); while (entries.hasMoreElements()) { ZipEntry entry = entries.nextElement(); File entryDestination = new File(toDir, entry.getName()); entryDestination.getParentFile().mkdirs(); if (entry.isDirectory()) entryDestination.mkdirs(); ... |
void | unzip(String sourceFileName, String destPath) unzip ZipFile zf = null; try { zf = new ZipFile(sourceFileName); Enumeration en = zf.entries(); while (en.hasMoreElements()) { ZipEntry zipEnt = (ZipEntry) en.nextElement(); saveEntry(destPath, zipEnt, zf); } finally { if (zf != null) zf.close(); |
void | unzip(String sourceZip, String targetDirectory) unzip FileInputStream fis = null; BufferedInputStream bis = null; ZipInputStream zis = null; try { fis = new FileInputStream(new File(sourceZip)); bis = new BufferedInputStream(fis); zis = new ZipInputStream(bis); for (ZipEntry ze = zis.getNextEntry(); ze != null; ze = zis.getNextEntry()) { ... |
void | unzip(String src, String dest, PrintStream stream) unzip src = src.replace("~", System.getProperty("user.home")); dest = dest.replace("~", System.getProperty("user.home")); if (!new File(src).exists()) { throw new RuntimeException(src + " does not exist."); ZipInputStream zis = new ZipInputStream(new CheckedInputStream(new FileInputStream(src), new CRC32())); innerUnzip(zis, dest, stream); zis.close(); ... |
void | unzip(String sZip) Unzip file Zip (terkompresi) byte[] buf = new byte[1024]; try { ZipInputStream zin = new ZipInputStream(new FileInputStream(sZip)); ZipEntry ze; while ((ze = zin.getNextEntry()) != null) { FileOutputStream out = new FileOutputStream(ze.getName()); int len; while ((len = zin.read(buf)) > 0) { ... |
String | unzip(String toUnpackName) unzip File file = new File(toUnpackName); return unzip(file); |
boolean | unzip(String zip, String dest) Unzip a zip file into the destination directory return unzip(new File(zip), new File(dest)); |
void | unzip(String zip, String folder) Unzips the given zip file into the given folder retaining the folder structure of the zip. if (zip == null || zip.length() == 0 || folder == null || folder.length() == 0) { return; try (ZipFile zipFile = new ZipFile(zip)) { Enumeration<? extends ZipEntry> entries = zipFile.entries(); while (entries.hasMoreElements()) { ZipEntry entry = entries.nextElement(); String currentEntry = entry.getName(); ... |