Java Utililty Methods Zip File List

List of utility methods to do Zip File List

Description

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

Method

voidzipFiles(String output, String sDir, String sSearch)
zip Files
File dir = new File(sDir).getCanonicalFile();
;
File[] files = dir.listFiles();
List<File> lst = new ArrayList<File>();
for (File f : files) {
    if (sSearch.equals("*")) {
        lst.add(f);
    } else if (sSearch.indexOf("*.") >= 0) {
...
voidzipFiles(String output_dir, List files)
zip Files
FileOutputStream fos = null;
ZipOutputStream zipOut = null;
FileInputStream fis = null;
try {
    fos = new FileOutputStream(output_dir);
    zipOut = new ZipOutputStream(new BufferedOutputStream(fos));
    for (File input : files) {
        fis = new FileInputStream(input);
...
voidzipFiles(String source, String target)
zip Files
zip(source, target);
booleanzipFiles(String srcFolder, String destZipFile)
zip Files
boolean result = false;
try {
    zipFolder(srcFolder, destZipFile);
    result = true;
} catch (Exception e) {
    System.out.println("Some Errors happned during the zip process");
} finally {
    return result;
...
voidzipFiles(ZipOutputStream out, String path, File... srcFiles)
zip Files
path = path.replaceAll("\\*", "/");
if (!path.endsWith("/")) {
    path += "/";
byte[] buf = new byte[1024];
try {
    for (File srcFile : srcFiles) {
        if (srcFile.isDirectory()) {
...
voidzipFilesTo(Vector fileVector, String baseDir, File destFile)
Zips all files in "fileVector" to the zipfile "destFile".
FileOutputStream ops = null;
ZipOutputStream zos = null;
int basedirlen = baseDir.length();
if (!baseDir.endsWith(File.separator))
    basedirlen++;
try {
    ops = new FileOutputStream(destFile);
    zos = new ZipOutputStream(ops);
...