List of utility methods to do Unzip InputStream
void | unzip(InputStream in, File destination) unzip byte[] buffer = new byte[1024]; ZipInputStream zis = new ZipInputStream(in); ZipEntry ze = zis.getNextEntry(); while (ze != null) { String fileName = ze.getName(); File newFile = new File(destination, fileName); if (ze.isDirectory()) { newFile.mkdirs(); ... |
void | unzip(InputStream in, File toDir) Unzips the given input stream of a ZIP to the given directory ZipInputStream zis = new ZipInputStream(new BufferedInputStream(in)); try { ZipEntry entry = zis.getNextEntry(); while (entry != null) { if (!entry.isDirectory()) { String entryName = entry.getName(); File toFile = new File(toDir, entryName); toFile.getParentFile().mkdirs(); ... |
void | unzip(InputStream input, File dest) Unzip the given inputstream into a directory. ZipInputStream zis = new ZipInputStream(input); ZipEntry entry; try { while ((entry = zis.getNextEntry()) != null) { if (entry.isDirectory()) { File dir = new File(dest, entry.getName()); dir.mkdir(); if (!dir.exists() || !dir.isDirectory()) { ... |
void | unzip(InputStream input, String targetDir) unzip File dir = new File(targetDir); if (!dir.exists() && !dir.mkdir()) { throw new IOException("Unable to create dir" + dir); ZipInputStream zipInput; zipInput = new ZipInputStream(input); ZipEntry entry; while ((entry = zipInput.getNextEntry()) != null) { ... |
void | unzip(InputStream inputStream, String destDirectory) Extracts an (Zip)InputStream to a directory specified by destDirectory (will be created if does not exists) File destDir = new File(destDirectory); if (!destDir.exists()) { destDir.mkdir(); ZipInputStream zipIn = new ZipInputStream(inputStream); ZipEntry entry = zipIn.getNextEntry(); while (entry != null) { String filePath = destDirectory + File.separator + entry.getName(); ... |
void | unzip(InputStream inputStream, String outputFolder) Unzips a file all into one directory byte[] buffer = new byte[1024]; try { File folder = new File(outputFolder); if (!folder.exists()) { folder.mkdir(); ZipInputStream zis = new ZipInputStream(inputStream); ZipEntry ze = zis.getNextEntry(); ... |
void | unzip(InputStream is, File destDir) unzip final int BUFFER = 2048; ZipInputStream zis = new ZipInputStream(new BufferedInputStream(is)); try { ZipEntry entry; while ((entry = zis.getNextEntry()) != null) { if (entry.isDirectory()) { File dir = new File(destDir, entry.getName()); if (!dir.mkdir()) { ... |
void | unzip(InputStream libInputStream, String path) unzip createFolder(path); ZipInputStream zis = new ZipInputStream(libInputStream); try { ZipEntry ze; byte[] buffer = new byte[4096]; while ((ze = zis.getNextEntry()) != null) { if (ze.isDirectory()) continue; ... |
void | unzip(InputStream source, File target) unzip final ZipInputStream zipStream = new ZipInputStream(source); ZipEntry nextEntry; while ((nextEntry = zipStream.getNextEntry()) != null) { final String name = nextEntry.getName(); if (!name.endsWith("/")) { final File nextFile = new File(target, name); final File parent = nextFile.getParentFile(); if (parent != null) { ... |
void | unzip(InputStream zin, File file) unzip FileOutputStream out = null; try { out = new FileOutputStream(file); joinStreams(zin, out); out.close(); } finally { failsafeClose(out); |