Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

sosc::ZipTool Class Reference

List of all members.

Public Methods

 ZipTool (int compressionLevel) throws IOException
InputStream getInputStream ()
void close () throws IOException
void addFile (InputStream fis1, String path) throws IOException

Public Attributes

Logger logger = Logger.getLogger("net.threebit.utils.sosc")

Private Attributes

ZipOutputStream zout
CRC32 crc = new CRC32()
byte[] buffer = new byte[250 * 1024]
PipedOutputStream pipedOutputStream = new PipedOutputStream()
PipedInputStream pipedInputStream = null
int compressionLevel = Deflater.NO_COMPRESSION

Detailed Description

This class is a generic file zipping/unzipping utility that manages zipping files for download and unzipping zipped files on upload

Definition at line 38 of file ZipTool.java.


Constructor & Destructor Documentation

sosc::ZipTool::ZipTool int    compressionLevel throws IOException [inline]
 

Creates a new ZipTool.

Parameters:
compressionLevel  The compression level to use during zipping. See ZipOutputStream.setLevel(int level)

Definition at line 66 of file ZipTool.java.

References sosc::ZipTool::compressionLevel, sosc::ZipTool::pipedInputStream, sosc::ZipTool::pipedOutputStream, and sosc::ZipTool::zout.


Member Function Documentation

void sosc::ZipTool::addFile InputStream    fis1,
String    path
throws IOException [inline]
 

Definition at line 90 of file ZipTool.java.

References sosc::ZipTool::buffer, sosc::ZipTool::compressionLevel, sosc::ZipTool::crc, sosc::OutputStreamCounter::getSize(), and sosc::ZipTool::zout.

void sosc::ZipTool::close   throws IOException [inline]
 

Closes all the streams.

Definition at line 83 of file ZipTool.java.

References sosc::ZipTool::zout.

InputStream sosc::ZipTool::getInputStream   [inline]
 

Returns an inputstream that contains the zipped files.

Definition at line 76 of file ZipTool.java.

References sosc::ZipTool::pipedInputStream.


Member Data Documentation

byte [] sosc::ZipTool::buffer = new byte[250 * 1024] [private]
 

64kB buffer

Definition at line 50 of file ZipTool.java.

Referenced by sosc::ZipTool::addFile().

int sosc::ZipTool::compressionLevel = Deflater.NO_COMPRESSION [private]
 

Compression level.

Definition at line 59 of file ZipTool.java.

Referenced by sosc::ZipTool::addFile(), and sosc::ZipTool::ZipTool().

CRC32 sosc::ZipTool::crc = new CRC32() [private]
 

a crc32 calculator

Definition at line 47 of file ZipTool.java.

Referenced by sosc::ZipTool::addFile().

Logger sosc::ZipTool::logger = Logger.getLogger("net.threebit.utils.sosc")
 

debuggin.

Definition at line 41 of file ZipTool.java.

PipedInputStream sosc::ZipTool::pipedInputStream = null [private]
 

the inputstream that the reading thread will read from.

Definition at line 56 of file ZipTool.java.

Referenced by sosc::ZipTool::getInputStream(), and sosc::ZipTool::ZipTool().

PipedOutputStream sosc::ZipTool::pipedOutputStream = new PipedOutputStream() [private]
 

the outputstream that the zipping thread will write to.

Definition at line 53 of file ZipTool.java.

Referenced by sosc::ZipTool::ZipTool().

ZipOutputStream sosc::ZipTool::zout [private]
 

the compressed output stream

Definition at line 44 of file ZipTool.java.

Referenced by sosc::ZipTool::addFile(), sosc::ZipTool::close(), and sosc::ZipTool::ZipTool().


The documentation for this class was generated from the following file:
Generated on Mon Jul 14 17:19:23 2003 for SOSC by doxygen1.2.15