Android Utililty Methods Zip Unzip File

List of utility methods to do Zip Unzip File

Description

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

Method

voidgUnzip(File srcFile, File destFile)
GUnzips a source File to a destination File.
FileOutputStream fos = null;
GZIPInputStream zIn = null;
InputStream fis = null;
try {
    fos = new FileOutputStream(destFile);
    fis = new FileInputStream(srcFile);
    zIn = new GZIPInputStream(fis);
    copy(zIn, fos);
...
voidunJarDirectory(final String in, final File fOut)
un Jar Directory
if (!fOut.exists()) {
    fOut.mkdirs();
if (!fOut.isDirectory()) {
    throw new IOException("Destination must be a directory.");
if (logger.isDebugEnabled()) {
    logger.debug("Extracting Grinder Analyzer to " + fOut.getPath()
...
Vectorunzip(File pZipFile)
unzip
File lTempDir = createTempDir();
return unzipDirectory(lTempDir, pZipFile);
Listunzip(String sourceFileName, String destPath)
unzip
if (sourceFileName.endsWith(".zip")) {
    ZipFile zf = new ZipFile(sourceFileName);
    Enumeration en = zf.entries();
    List v = new ArrayList();
    while (en.hasMoreElements()) {
        ZipEntry zipEnt = (ZipEntry) en.nextElement();
        saveEntry(destPath, zipEnt, zf);
        if (!zipEnt.isDirectory()) {
...
booleanzip(String filePath, String zipPath)
zip
try {
    File file = new File(filePath);
    BufferedInputStream bis = null;
    FileOutputStream fos = new FileOutputStream(zipPath);
    ZipOutputStream zos = new ZipOutputStream(
            new BufferedOutputStream(fos));
    if (file.isDirectory()) {
        int baseLength = file.getParent().length() + 1;
...
voidzip(String sourceDir, String zipFile)
zip
ZipOutputStream zos = null;
try {
    zos = new ZipOutputStream(new BufferedOutputStream(
            new FileOutputStream(zipFile)));
    File file = new File(sourceDir);
    String basePath = null;
    if (file.isDirectory()) {
        basePath = file.getPath();
...
voidzip(String[] files, String destZipFilePath)
Compresses files represented in an array of paths
List<File> listFiles = new ArrayList<File>();
for (int i = 0; i < files.length; i++) {
    listFiles.add(new File(files[i]));
zip(listFiles, destZipFilePath);
voidzip(String[] files, String zipFile)
zip
BufferedInputStream origin = null;
ZipOutputStream out = new ZipOutputStream(new BufferedOutputStream(
        new FileOutputStream(zipFile)));
try {
    byte data[] = new byte[BUFFER_SIZE];
    for (int i = 0; i < files.length; i++) {
        FileInputStream fi = new FileInputStream(files[i]);
        origin = new BufferedInputStream(fi, BUFFER_SIZE);
...
voidzip(String[] files, String zipFile)
zip
BufferedInputStream origin = null;
ZipOutputStream out = new ZipOutputStream(new BufferedOutputStream(
        new FileOutputStream(zipFile)));
try {
    byte data[] = new byte[BUFFER_SIZE];
    for (int i = 0; i < files.length; i++) {
        FileInputStream fi = new FileInputStream(files[i]);
        origin = new BufferedInputStream(fi, BUFFER_SIZE);
...
voidzip(String[] files, String zipFile)
zip
BufferedInputStream origin = null;
ZipOutputStream out = new ZipOutputStream(new BufferedOutputStream(
        new FileOutputStream(zipFile)));
try {
    byte data[] = new byte[BUFFER_SIZE];
    for (int i = 0; i < files.length; i++) {
        FileInputStream fi = new FileInputStream(files[i]);
        origin = new BufferedInputStream(fi, BUFFER_SIZE);
...