Secure iNet Factory

com.jscape.zip
Class Zip

java.lang.Object
  extended bycom.jscape.zip.Zip
All Implemented Interfaces:
Archive

public class Zip
extends java.lang.Object
implements Archive

Implements the basic functionality of ZIP compression and decompression.


Field Summary
static int BUF_SIZE
          The buffer size.
 
Constructor Summary
Zip()
          Creates a new Zip instance.
 
Method Summary
 void addArchiveListener(ArchiveListener listener)
          Adds listener.
 void compress(java.io.File file)
          Creates a new ZIP archive.
 void compress(java.io.File file, java.io.File output)
          Creates a new ZIP archive.
 void compress(java.io.File output, java.util.Vector files)
          Compresses list of files to specified output file.
 void decompress(java.io.File file)
          Decompress all the files in given ZIP archive.
 void decompress(java.io.File file, java.io.File output)
          Decompress all the files in given ZIP archive.
 void removeArchiveListener(ArchiveListener listener)
          Removes listener.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BUF_SIZE

public static final int BUF_SIZE
The buffer size.

See Also:
Constant Field Values
Constructor Detail

Zip

public Zip()
Creates a new Zip instance.

Method Detail

compress

public void compress(java.io.File file)
              throws ArchiveException
Creates a new ZIP archive.

Specified by:
compress in interface Archive
Parameters:
file - the input file
Throws:
ArchiveException - if error occurs

compress

public void compress(java.io.File file,
                     java.io.File output)
              throws ArchiveException
Creates a new ZIP archive.

Specified by:
compress in interface Archive
Parameters:
file - the input file
output - the output file or directory
Throws:
ArchiveException - if error occurs

compress

public void compress(java.io.File output,
                     java.util.Vector files)
              throws ArchiveException
Compresses list of files to specified output file.

Parameters:
output - the ZIP output file
files - the file list to be compressed
Throws:
ArchiveException - if an error occurs

decompress

public void decompress(java.io.File file)
                throws ArchiveException
Decompress all the files in given ZIP archive.

Specified by:
decompress in interface Archive
Parameters:
file - the ZIP file
Throws:
ArchiveException - if error occurs

decompress

public void decompress(java.io.File file,
                       java.io.File output)
                throws ArchiveException
Decompress all the files in given ZIP archive.

Specified by:
decompress in interface Archive
Parameters:
file - the ZIP file
output - the output directory to decompress files to
Throws:
ArchiveException - if error occurs

addArchiveListener

public void addArchiveListener(ArchiveListener listener)
Adds listener.

Specified by:
addArchiveListener in interface Archive
Parameters:
listener - the listener
See Also:
Archive.addArchiveListener(ArchiveListener)

removeArchiveListener

public void removeArchiveListener(ArchiveListener listener)
Removes listener.

Specified by:
removeArchiveListener in interface Archive
Parameters:
listener - the listener
See Also:
Archive.removeArchiveListener(ArchiveListener)

Secure iNet Factory

Copyright JSCAPE 1999-2008 All Rights Reserved