List of utility methods to do Unzip to Folder
void | unzip(String zip, String path) unzip final int BUF_SIZE = 2048; FileInputStream fis = new FileInputStream(zip); ZipInputStream zis = new ZipInputStream(new BufferedInputStream(fis)); ZipEntry entry; while ((entry = zis.getNextEntry()) != null) { int count; byte data[] = new byte[BUF_SIZE]; FileOutputStream fos = new FileOutputStream(new File(path, entry.getName())); ... |
void | unzip(String zip, String unzipDir, int bufferSize) Unzips a zipFile in unzip directory. createDirs(unzipDir); ZipFile zipFile = new ZipFile(zip); try { Enumeration entries = zipFile.entries(); while (entries.hasMoreElements()) { ZipEntry entry = (ZipEntry) entries.nextElement(); File file = new File(unzipDir, entry.getName()); if (entry.isDirectory()) { ... |
boolean | Unzip(String zipFile, String outputDirectory) Unzip a zipped file (eg. String outDir = outputDirectory; if (!outDir.endsWith("/") && !outDir.endsWith("\\")) outDir += File.separator; BufferedOutputStream dest = null; BufferedInputStream is = null; int BUFFER = 2048; ZipEntry entry; ZipFile zipfile; ... |
void | unzip(String zipFile, String targetFolder) Unzip the component file to the user folder. Exception exception = null; ZipFile zip = new ZipFile(zipFile); byte[] buf = new byte[8192]; try { Enumeration<ZipEntry> enumeration = (Enumeration<ZipEntry>) zip.entries(); while (enumeration.hasMoreElements()) { ZipEntry entry = enumeration.nextElement(); File file = new File(targetFolder, entry.getName()); ... |
void | unzip(String zipFile, String targetFolder, String... fileSuffixes) unzip unzip(zipFile, targetFolder, true, fileSuffixes); |
void | unzip(String zipFile, String targetPath) unzip log.log(Level.INFO, "Extracting {0} ...", zipFile); log.log(Level.INFO, "...target directory: {0}", targetPath); File path = new File(targetPath); path.delete(); path.mkdirs(); BufferedOutputStream dest = null; FileInputStream fis = new FileInputStream(zipFile); ZipInputStream zis = new ZipInputStream(new BufferedInputStream(fis)); ... |
void | unzip(String zipFileName, String outputDirectory) unzip ZipInputStream in = new ZipInputStream(new FileInputStream(zipFileName)); ZipEntry z; while ((z = in.getNextEntry()) != null) { System.out.println("unziping " + z.getName()); if (z.isDirectory()) { String name = z.getName(); name = name.substring(0, name.length() - 1); File f = new File(outputDirectory + File.separator + name); ... |
void | unzip(String zipFileName, String targetFolderPath) unzip Enumeration entries; ZipFile zipFile; try { File targetFolder = new File(targetFolderPath); if (!targetFolder.exists()) { targetFolder.mkdirs(); String canonicalTargetPath = targetFolder.getCanonicalPath(); ... |
void | unzip(String zipFileName, String targetPath) unzip ZipFile zipFile = new ZipFile(zipFileName); Enumeration<? extends ZipEntry> entries = zipFile.entries(); while (entries.hasMoreElements()) { ZipEntry entry = entries.nextElement(); if (entry.isDirectory()) { (new File(targetPath, entry.getName())).mkdir(); File outputFile = new File(targetPath, entry.getName()); ... |
void | unzip(String zipFileName, String unzipdir) unzip try (ZipInputStream zis = new ZipInputStream(new BufferedInputStream(new FileInputStream(zipFileName)))) { ZipEntry entry = null; while ((entry = zis.getNextEntry()) != null) { extractEntryContent(zis, entry, unzipdir); System.out.println( "ZIP file's contents have been extracted to " + (new File(unzipdir)).getAbsolutePath()); } catch (IOException e) { ... |