com.alee.utils
Class ZipUtils

java.lang.Object
  extended by com.alee.utils.ZipUtils

public final class ZipUtils
extends java.lang.Object

This class provides a set of utilities to work with ZIP files.

Author:
Mikle Garin

Constructor Summary
ZipUtils()
           
 
Method Summary
static java.lang.String getZipEntryFileLocation(java.util.zip.ZipEntry zipEntry)
          Returns file location for the specified zip entry.
static java.lang.String getZipEntryFileName(java.util.zip.ZipEntry zipEntry)
          Returns file name for the specified zip entry.
static boolean unzip(java.io.File archive, java.io.File dst)
          Extracts ZIP archive contents into destination directory.
static boolean unzip(java.io.File archive, java.io.File dst, UnzipListener listener)
          Extracts ZIP archive contents into destination directory.
static boolean unzip(java.lang.String archive, java.lang.String dst)
          Extracts ZIP archive contents into destination directory.
static boolean unzip(java.lang.String archive, java.lang.String dst, UnzipListener listener)
          Extracts ZIP archive contents into destination directory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ZipUtils

public ZipUtils()
Method Detail

unzip

public static boolean unzip(java.lang.String archive,
                            java.lang.String dst)
Extracts ZIP archive contents into destination directory. Any folder required for extraction are created in the process.

Parameters:
archive - ZIP file path
dst - destination directory path
Returns:
true if archive was extracted successfully

unzip

public static boolean unzip(java.lang.String archive,
                            java.lang.String dst,
                            UnzipListener listener)
Extracts ZIP archive contents into destination directory. Any folder required for extraction are created in the process.

Parameters:
archive - ZIP file path
dst - destination directory path
listener - extraction process listener
Returns:
true if archive was extracted successfully

unzip

public static boolean unzip(java.io.File archive,
                            java.io.File dst)
Extracts ZIP archive contents into destination directory. Any folder required for extraction are created in the process.

Parameters:
archive - ZIP file
dst - destination directory
Returns:
true if archive was extracted successfully

unzip

public static boolean unzip(java.io.File archive,
                            java.io.File dst,
                            UnzipListener listener)
Extracts ZIP archive contents into destination directory. Any folder required for extraction are created in the process.

Parameters:
archive - ZIP file
dst - destination directory
listener - extraction process listener
Returns:
true if archive was extracted successfully

getZipEntryFileName

public static java.lang.String getZipEntryFileName(java.util.zip.ZipEntry zipEntry)
Returns file name for the specified zip entry.

Parameters:
zipEntry - zip entry to process
Returns:
file name for the specified zip entry

getZipEntryFileLocation

public static java.lang.String getZipEntryFileLocation(java.util.zip.ZipEntry zipEntry)
Returns file location for the specified zip entry.

Parameters:
zipEntry - zip entry to process
Returns:
file location for the specified zip entry