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 zip, File dest)
Dado un fichero comprimido en formato zip, lo descomprime en el directorio indicado.
FileInputStream fileInputStream = new FileInputStream(zip);
ZipInputStream zipInputStream = new ZipInputStream(new BufferedInputStream(fileInputStream));
ZipEntry entry = null;
while ((entry = zipInputStream.getNextEntry()) != null) {
    String outputFilename = dest.getAbsolutePath() + File.separator + entry.getName();
    int count;
    byte data[] = new byte[BUFFER_SIZE];
    FileOutputStream fos = new FileOutputStream(outputFilename);
...
voidunzip(File zip, File destination)
Unzips the given zip File into a new directory called destination.
ZipFile zipFile = null;
try {
    zipFile = new ZipFile(zip);
    for (ZipEntry zipEntry : Collections.list(zipFile.entries())) {
        File file = new File(destination, zipEntry.getName());
        if (zipEntry.isDirectory()) {
            file.mkdirs();
        } else {
...
voidunzip(File zip, File dir)
A quick and dirty method to unzip an archive into a directory.
dir.mkdirs();
InputStream in = new BufferedInputStream(new FileInputStream(zip));
ZipInputStream zin = new ZipInputStream(in);
ZipEntry e;
while ((e = zin.getNextEntry()) != null) {
    File f = new File(dir, e.getName());
    if (e.isDirectory()) {
        f.mkdirs();
...
voidunzip(File zip, File directory)
unzip
ZipFile zipFile = new ZipFile(zip);
try {
    Enumeration<? extends ZipEntry> entries = zipFile.entries();
    while (entries.hasMoreElements()) {
        ZipEntry zipEntry = entries.nextElement();
        if (zipEntry.isDirectory()) {
            File temp = new File(directory + File.separator + zipEntry.getName());
            temp.mkdirs();
...
voidunzip(File zip, File extractTo)
unzip
ZipFile archive = new ZipFile(zip);
Enumeration e = archive.entries();
while (e.hasMoreElements()) {
    ZipEntry entry = (ZipEntry) e.nextElement();
    File file = new File(extractTo, entry.getName());
    if (entry.isDirectory() && !file.exists()) {
        file.mkdirs();
    } else {
...
voidunzip(File zip, File extractTo)
Desenzippa un fitxer .zip en un directori
try {
    ZipFile archive = new ZipFile(zip);
    Enumeration<?> e = archive.entries();
    while (e.hasMoreElements()) {
        ZipEntry entry = (ZipEntry) e.nextElement();
        File file = new File(extractTo, entry.getName());
        if (entry.isDirectory() && !file.exists()) {
            file.mkdirs();
...
voidunzip(File zip, File location)
Unzips a zip compressed file to a specific directory
FileInputStream zipFileInput = new FileInputStream(zip.getAbsoluteFile());
ZipInputStream zipInput = new ZipInputStream(zipFileInput);
ZipEntry entry = null;
String baseDir = null;
if (location == null) {
    baseDir = zip.getParentFile().getAbsolutePath();
} else {
    baseDir = location.getAbsolutePath();
...
voidunzip(File zip, File targetDir)
unzip
unzip(new FileInputStream(zip), targetDir);
voidunzip(File zip, File toDir)
unzip
ZipFile zf = new ZipFile(zip);
try {
    Enumeration<? extends ZipEntry> entries = zf.entries();
    while (entries.hasMoreElements()) {
        ZipEntry entry = entries.nextElement();
        File file = new File(toDir, entry.getName());
        file.getParentFile().mkdirs();
        if (entry.isDirectory()) {
...
Listunzip(File zip, File toDir)
unzip
ZipFile zf = null;
List<File> files = null;
try {
    zf = new ZipFile(zip);
    files = new ArrayList<File>();
    Enumeration<?> entries = zf.entries();
    while (entries.hasMoreElements()) {
        ZipEntry entry = (ZipEntry) entries.nextElement();
...