List of utility methods to do Zip Unzip File
void | zip(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); ... |
void | zip(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); ... |
boolean | zip(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( ... |
boolean | zip(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]); ... |
void | zip(List 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); ... |
void | zipFile(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; ... |
boolean | zipFileAtPath(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() ... |
void | decompress(File file) decompress decompress(file, true); |
void | decompress(File file) decompress decompress(file, true); |
void | decompress(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) { ... |