rabbit.handler
Class GZIPHandler

java.lang.Object
  |
  +--rabbit.handler.BaseHandler
        |
        +--rabbit.handler.GZIPHandler
All Implemented Interfaces:
Handler
Direct Known Subclasses:
FilterHandler

public class GZIPHandler
extends BaseHandler

This class is used to gzip streams.


Field Summary
 
Fields inherited from class rabbit.handler.BaseHandler
cacheStream, clientstream, con, contentstream, entry, maycache, mayfilter, request, response, size
 
Constructor Summary
GZIPHandler(Connection con, HTTPHeader request, HTTPHeader response, java.io.InputStream contentstream, MultiOutputStream clientstream, boolean maycache, boolean mayfilter, long size)
          Create a new GZIPHansler for the given request.
 
Method Summary
protected  void finishStream()
          This method is used to finish the stream for the data being sent.
protected  void prepareStream()
          This method is used to prepare the stream for the data being sent.
static void setup(java.util.Properties prop)
          Setup this class.
 
Methods inherited from class rabbit.handler.BaseHandler
addCacheStream, finish, handle, removeCache, send, setPartialContent, writeHeader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GZIPHandler

public GZIPHandler(Connection con,
                   HTTPHeader request,
                   HTTPHeader response,
                   java.io.InputStream contentstream,
                   MultiOutputStream clientstream,
                   boolean maycache,
                   boolean mayfilter,
                   long size)
Create a new GZIPHansler for the given request.

Parameters:
con - the Connection handling the request.
request - the actual request made.
response - the actual response.
contentstream - the stream to read data from.
clientstream - the stream to write data to.
maycache - May we cache this request?
mayfilter - May we filter this request?
size - the size of the data beeing handled.
Method Detail

prepareStream

protected void prepareStream()
                      throws java.io.IOException
This method is used to prepare the stream for the data being sent. This method sets the stream up for gzipping.

Overrides:
prepareStream in class BaseHandler
java.io.IOException

finishStream

protected void finishStream()
                     throws java.io.IOException
This method is used to finish the stream for the data being sent. This method finishes the gzipping.

Overrides:
finishStream in class BaseHandler
java.io.IOException

setup

public static void setup(java.util.Properties prop)
Setup this class.

Parameters:
prop - the properties of this class.