Android Utililty Methods Zip File Create

List of utility methods to do Zip File Create

Description

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

Method

voidgenerateKMZ(String inputFileName, String outputFileName)
generates a kmz zip file
try {
    BufferedInputStream origin = null;
    FileOutputStream dest = new FileOutputStream("outputFileName");
    ZipOutputStream out = new ZipOutputStream(
            new BufferedOutputStream(dest));
    byte data[] = new byte[BUFFER];
    File f = new File(inputFileName);
    System.out.println("Adding: " + f.getName());
...
FilezipFiles(String compressName, File[] files)
compress some files to a zip file
File targetFile = new File(System.getProperty("java.io.tmpdir")
        + compressName + ".zip");
try {
    byte[] buf = new byte[1024];
    int len;
    FileOutputStream fos = new FileOutputStream(targetFile);
    BufferedOutputStream bos = new BufferedOutputStream(fos);
    ZipOutputStream zos = new ZipOutputStream(bos);
...
voidzipFile(File resFile, ZipOutputStream zipout, String rootpath)
zip File
rootpath = rootpath
        + (rootpath.trim().length() == 0 ? "" : File.separator)
        + resFile.getName();
rootpath = new String(rootpath.getBytes("8859_1"), "GB2312");
if (resFile.isDirectory()) {
    File[] fileList = resFile.listFiles();
    for (File file : fileList) {
        zipFile(file, zipout, rootpath);
...
voidzipFiles(Collection resFileList, File zipFile)
zip Files
ZipOutputStream zipout = new ZipOutputStream(
        new BufferedOutputStream(new FileOutputStream(zipFile),
                BUFF_SIZE));
for (File resFile : resFileList) {
    zipFile(resFile, zipout, "");
zipout.close();
voidzipFiles(Collection resFileList, File zipFile, String comment)
zip Files
ZipOutputStream zipout = new ZipOutputStream(
        new BufferedOutputStream(new FileOutputStream(zipFile),
                BUFF_SIZE));
for (File resFile : resFileList) {
    zipFile(resFile, zipout, "");
zipout.setComment(comment);
zipout.close();
...
voidzipFiles(Collection resFileList, File zipFile)
zip Files
ZipOutputStream zipout = new ZipOutputStream(
        new BufferedOutputStream(new FileOutputStream(zipFile),
                BUFF_SIZE));
for (File resFile : resFileList) {
    zipFile(resFile, zipout, "");
zipout.close();
voidzipFiles(Collection resFileList, File zipFile)
zip Files
ZipOutputStream zipout = new ZipOutputStream(
        new BufferedOutputStream(new FileOutputStream(zipFile),
                BUFF_SIZE));
for (File resFile : resFileList) {
    zipFile(resFile, zipout, "");
zipout.close();
voidzipFiles(Collection resFileList, File zipFile)
zip Files
if (!zipFile.exists()) {
    zipFile.createNewFile();
ZipOutputStream zipout = new ZipOutputStream(
        new BufferedOutputStream(new FileOutputStream(zipFile),
                BUFF_SIZE));
for (File resFile : resFileList) {
    zipFile(resFile, zipout, "");
...
voidzipFiles(Collection resFileList, File zipFile)
zip Files
ZipOutputStream zipout = new ZipOutputStream(
        new BufferedOutputStream(new FileOutputStream(zipFile),
                BUFF_SIZE));
for (File resFile : resFileList) {
    zipFile(resFile, zipout, "");
zipout.close();
voidzipFiles(Collection resFileList, File zipFile)
zip Files
ZipOutputStream zipout = null;
try {
    zipout = new ZipOutputStream(new BufferedOutputStream(
            new FileOutputStream(zipFile), BUFF_SIZE));
    for (File resFile : resFileList) {
        zipFile(resFile, zipout, "");
} finally {
...