Java Utililty Methods Unzip File

List of utility methods to do Unzip File

Description

The list of methods to do Unzip File are organized into topic(s).

Method

voidunzip(File zipfile, File directory)
unzip
ZipFile zfile = new ZipFile(zipfile);
Enumeration<? extends ZipEntry> entries = zfile.entries();
while (entries.hasMoreElements()) {
    ZipEntry entry = entries.nextElement();
    File file = new File(directory, entry.getName());
    if (entry.isDirectory()) {
        file.mkdirs();
    } else {
...
voidunzip(File zipfile, File directory)
unzip
ZipFile zfile = new ZipFile(zipfile);
Enumeration<? extends ZipEntry> entries = zfile.entries();
while (entries.hasMoreElements()) {
    ZipEntry entry = entries.nextElement();
    File file = new File(directory, entry.getName());
    if (entry.isDirectory()) {
        file.mkdirs();
    } else {
...
voidunzip(File zipFile, File outputDir)
unzip
InputStream input = new BufferedInputStream(new FileInputStream(zipFile));
ZipInputStream zipInput = new ZipInputStream(input);
ZipEntry entry;
while ((entry = zipInput.getNextEntry()) != null) {
    File entryFile = new File(outputDir.getPath() + File.separatorChar + entry.getName());
    if (entry.isDirectory()) {
        entryFile.mkdirs();
    } else {
...
voidunzip(File zipFile, File outputFolder)
unzip
byte[] buffer = new byte[1024];
ZipInputStream zis = null;
try {
    zis = new ZipInputStream(new FileInputStream(zipFile));
    ZipEntry ze = zis.getNextEntry();
    while (ze != null) {
        String fileName = ze.getName();
        File newFile = new File(outputFolder.getAbsolutePath() + File.separator + fileName);
...
voidunZip(File zipFile, String desdir)
un Zip
ZipFile zip = new ZipFile(zipFile);
Enumeration<?> en = zip.entries();
ZipEntry entry = null;
byte[] buffer = new byte[8192];
int length = -1;
InputStream input = null;
BufferedOutputStream bos = null;
File file = null;
...
voidunZip(File zipFile, String extPlace, boolean reservZipFile)
un Zip
ZipInputStream in = new ZipInputStream(new FileInputStream(zipFile));
ZipEntry entry = null;
while ((entry = in.getNextEntry()) != null) {
    String entryName = entry.getName();
    if (entry.isDirectory()) {
        File file = new File(extPlace + entryName);
        file.mkdirs();
    } else {
...
voidunzip(File zipFileName, File targetDir)
unzip
unzip(zipFileName, targetDir, new FileFilter() {
    public boolean accept(File file) {
        return true;
});
voidunzip(File zipName, File destDir)
Convenience method unzipping zipName into destDir, cleaning up destDir first.
rm(destDir);
destDir.mkdir();
ZipFile zipFile = new ZipFile(zipName);
Enumeration<? extends ZipEntry> entries = zipFile.entries();
while (entries.hasMoreElements()) {
    ZipEntry entry = entries.nextElement();
    InputStream in = zipFile.getInputStream(entry);
    File targetFile = new File(destDir, entry.getName());
...
voidunZip(File zipPath, File destPath)
un Zip
if (!destPath.exists()) {
    destPath.mkdirs();
ZipInputStream in = new ZipInputStream(new FileInputStream(zipPath));
ZipEntry entry = in.getNextEntry();
while (entry != null) {
    String filePath = destPath + File.separator + entry.getName();
    if (!entry.isDirectory()) {
...
Listunzip(File zippedFile)
Uncompresses zipped files
return unzip(zippedFile, null);