nl.knowledgeplaza.util
Class ZipUtil

java.lang.Object
  extended by nl.knowledgeplaza.util.ZipUtil

public class ZipUtil
extends Object


Field Summary
static String SOURCECODE_VERSION
          Standard variable for determining version of a class file.
 
Constructor Summary
ZipUtil()
           
 
Method Summary
static void main(String[] args)
           
static Map readZipFile(File file)
           
static Map readZipFile(InputStream inputStream)
           
static Map readZipFile(ZipInputStream zipInputStream)
           
static void writeZipFileEntry(ZipOutputStream zipOutputStream, String zipEntryName, byte[] byteArray)
          Creates a new zip file entry with the given name and byte data.
static void writeZipFileEntry(ZipOutputStream zipOutputStream, String zipEntryName, InputStream inputStream)
           
static void zipDirectoryRecusively(File dir, File file)
           
static void zipDirectoryRecusively(File dir, FileFilter fileFilter, OutputStream outputStream)
           
static void zipDirectoryRecusively(File dir, OutputStream outputStream)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SOURCECODE_VERSION

public static final String SOURCECODE_VERSION
Standard variable for determining version of a class file.

See Also:
Constant Field Values
Constructor Detail

ZipUtil

public ZipUtil()
Method Detail

zipDirectoryRecusively

public static void zipDirectoryRecusively(File dir,
                                          File file)
                                   throws IOException
Parameters:
dir -
outputStream -
Throws:
IOException

zipDirectoryRecusively

public static void zipDirectoryRecusively(File dir,
                                          OutputStream outputStream)
                                   throws IOException
Parameters:
dir -
outputStream -
Throws:
IOException

zipDirectoryRecusively

public static void zipDirectoryRecusively(File dir,
                                          FileFilter fileFilter,
                                          OutputStream outputStream)
                                   throws IOException
Parameters:
dir -
fileFilter -
outputStream -
Throws:
IOException

writeZipFileEntry

public static void writeZipFileEntry(ZipOutputStream zipOutputStream,
                                     String zipEntryName,
                                     byte[] byteArray)
                              throws IOException
Creates a new zip file entry with the given name and byte data.

Parameters:
zipOutputStream - output stream new zip entry will be written to
zipEntryName - zip file entry name
byteArray - array of bytes to write representing file entry data
Throws:
IOException

writeZipFileEntry

public static void writeZipFileEntry(ZipOutputStream zipOutputStream,
                                     String zipEntryName,
                                     InputStream inputStream)
                              throws IOException
Parameters:
zipOutputStream -
zipEntryName -
inputStream -
Throws:
IOException

readZipFile

public static Map readZipFile(File file)
                       throws IOException,
                              FileNotFoundException
Throws:
IOException
FileNotFoundException

readZipFile

public static Map readZipFile(InputStream inputStream)
                       throws IOException
Throws:
IOException

readZipFile

public static Map readZipFile(ZipInputStream zipInputStream)
                       throws IOException
Throws:
IOException

main

public static void main(String[] args)


Copyright © 2012 KnowledgePlaza. All Rights Reserved.