List of utility methods to do Unzip File
void | unzip(File epubfile, File destination) Unpacks the given epubfile to the destination directory. if (!destination.exists()) { if (!destination.mkdirs()) { throw new IOException("Could not create directory for EPUB contents"); ZipInputStream in = new ZipInputStream(new FileInputStream(epubfile)); byte[] buf = new byte[BUFFERSIZE]; ZipEntry entry = null; ... |
void | unzip(File file, File dest) unzip ZipFile zipFile = new ZipFile(file); Enumeration<? extends ZipEntry> entries = zipFile.entries(); while (entries.hasMoreElements()) { ZipEntry entry = entries.nextElement(); File entryDest = new File(dest, entry.getName()); if (entry.isDirectory()) { entryDest.mkdir(); } else { ... |
void | unzip(File file, File destDir) Unzips the zip file "file" into the directory "dest" destDir.mkdir(); try { ZipFile zipFile = new ZipFile(file); Enumeration entries = zipFile.entries(); while (entries.hasMoreElements()) { ZipEntry ze = (ZipEntry) entries.nextElement(); if (ze.isDirectory()) (new File(destDir, ze.getName())).mkdir(); ... |
void | unzip(File file, File directory) Unpacks a zip file into a directory. ZipFile zipFile = new ZipFile(file); try { Enumeration<? extends ZipEntry> entries = zipFile.entries(); while (entries.hasMoreElements()) { ZipEntry entry = entries.nextElement(); File entryFile = new File(directory, entry.getName()); if (entry.isDirectory()) entryFile.mkdirs(); ... |
void | unzip(File file, File targetDirectory) Unzip a file to a specified directory Enumeration<? extends ZipEntry> entries; ZipFile zipFile = new ZipFile(file); try { File extractFile; entries = zipFile.entries(); while (entries.hasMoreElements()) { ZipEntry entry = entries.nextElement(); if (!entry.getName().startsWith(".")) { ... |
void | unzip(File file, File targetDirectory) Unzip a file to a specified directory Enumeration<? extends ZipEntry> entries; ZipFile zipFile = new ZipFile(file); entries = zipFile.entries(); while (entries.hasMoreElements()) { ZipEntry entry = entries.nextElement(); if (!entry.getName().startsWith(".")) { if (entry.isDirectory()) { (new File(targetDirectory, entry.getName())).mkdirs(); ... |
void | unzip(File file, File toDir) unzip unzip(file, toDir, null); |
void | unzip(File file, File toDirectory) Unzips a given file to the set directory byte[] buffer = new byte[1024]; if (!toDirectory.exists()) toDirectory.mkdir(); ZipInputStream zips = new ZipInputStream(new FileInputStream(file)); ZipEntry zip = zips.getNextEntry(); while (zip != null) { String fileName = zip.getName(); File newFile = new File(toDirectory.getPath() + File.separator + fileName); ... |
File | unzip(File file, String destination, String container) unzip File result = new File(destination + "/" + container); result.mkdir(); destination = destination + "/" + container + "/"; try { ZipFile zipFile = new ZipFile(file); Enumeration<? extends ZipEntry> entries = zipFile.entries(); while (entries.hasMoreElements()) { ZipEntry ze = entries.nextElement(); ... |
boolean | unZip(File file, String outPath, String zipFileName) un Zip FileInputStream is = null; try { is = new FileInputStream(file); return unZip(is, outPath, zipFileName); } catch (FileNotFoundException e) { e.printStackTrace(); } finally { if (is != null) { ... |