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

voidzip(String[] files, String zipFile)
zip
BufferedInputStream origin = null;
try {
    ZipOutputStream out = new ZipOutputStream(
            new BufferedOutputStream(new FileOutputStream(zipFile)));
    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);
...
booleanzip(File srcFile, File targetFile)
zip
if (!srcFile.exists())
    return false;
if (!targetFile.getParentFile().exists())
    targetFile.getParentFile().mkdir();
try {
    FileInputStream localFileInputStream = new FileInputStream(
            targetFile);
    ZipOutputStream localZipOutputStream = new ZipOutputStream(
...
booleanzip(File[] _files, File _zipFile)
zip
try {
    BufferedInputStream origin = null;
    FileOutputStream dest = new FileOutputStream(_zipFile);
    ZipOutputStream out = new ZipOutputStream(
            new BufferedOutputStream(dest));
    byte data[] = new byte[BUFFER];
    for (int i = 0; i < _files.length; i++) {
        Log.d("Compress", "Adding: " + _files[i]);
...
voidzip(List listFiles, String destZipFilePath)
Compresses a list of files to a destination zip file
ZipOutputStream zos = null;
try {
    zos = new ZipOutputStream(new FileOutputStream(destZipFilePath));
    for (File file : listFiles) {
        if (file.isDirectory()) {
            zipDirectory(file, file.getName(), zos);
        } else {
            zipFile(file, zos);
...
voidzipFile(File source, String basePath, ZipOutputStream zos)
create date:2009- 6- 9 author:Administrator
File[] files = null;
if (source.isDirectory()) {
    files = source.listFiles();
} else {
    files = new File[1];
    files[0] = source;
String pathName;
...
booleanzipFileAtPath(File sourceFile, String toLocation)
zip File At Path
final int BUFFER = 2048;
try {
    BufferedInputStream origin = null;
    FileOutputStream dest = new FileOutputStream(toLocation);
    ZipOutputStream out = new ZipOutputStream(
            new BufferedOutputStream(dest));
    if (sourceFile.isDirectory()) {
        zipSubFolder(out, sourceFile, sourceFile.getParent()
...
voiddecompress(File file)
decompress
decompress(file, true);
voiddecompress(File file)
decompress
decompress(file, true);
voiddecompress(File file, boolean delete)
decompress
FileInputStream fis = new FileInputStream(file);
FileOutputStream fos = new FileOutputStream(file.getPath().replace(
        EXT, ""));
decompress(fis, fos);
fis.close();
fos.flush();
fos.close();
if (delete) {
...