common-util

local.tomas.util.zip
Class ZipUtilities

java.lang.Object
  extended by local.tomas.util.zip.ZipUtilities

public class ZipUtilities
extends Object

Zip utilities.

Author:
tomas.teubner

Method Summary
static void create(ZipOutputStream zip, File sourceDir)
          Fill zip output stream from all files in source directory.
static void extract(ZipFile zip, File targetDir)
          Extract all files from zip archive.
static void extract(ZipFile zip, ZipEntry entry, File target)
          Extract file from zip archive.
static void extract(ZipInputStream zip, File targetDir)
          Extract all files from zip input stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

extract

public static void extract(ZipFile zip,
                           ZipEntry entry,
                           File target)
                    throws IOException
Extract file from zip archive.

Parameters:
zip - zip archive
entry - zip entry
target - target file
Throws:
IOException

extract

public static void extract(ZipFile zip,
                           File targetDir)
                    throws IOException
Extract all files from zip archive.

Parameters:
zip - zip archive
targetDir - target directory
Throws:
IOException

extract

public static void extract(ZipInputStream zip,
                           File targetDir)
                    throws IOException
Extract all files from zip input stream.

Parameters:
zip - zip input stream
targetDir - target directory
Throws:
IOException

create

public static void create(ZipOutputStream zip,
                          File sourceDir)
                   throws IOException
Fill zip output stream from all files in source directory.

Parameters:
zip - zip output stream
sourceDir - source directory
Throws:
IOException

common-util

Copyright © 2005-2007 Tomas Teubner. All Rights Reserved.