|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectrabbit.handler.BaseHandler
rabbit.handler.ImageHandler
This class filters images to low quality jpegs.
| Field Summary |
| Fields inherited from class rabbit.handler.BaseHandler |
cacheStream, clientstream, con, contentstream, entry, maycache, mayfilter, request, response, size |
| Constructor Summary | |
ImageHandler(Connection con,
HTTPHeader request,
HTTPHeader response,
java.io.InputStream contentstream,
MultiOutputStream clientstream,
boolean maycache,
boolean mayfilter,
long size)
Create a new ImageHansler for the given request. |
|
| Method Summary | |
void |
addCacheStream()
Set up the cache stream if available. |
protected void |
convertImage()
Convert the image into a low quality jpeg. |
protected void |
finish()
clear up the mess we made (remove intermediate files etc). |
protected void |
readImage()
Read in the image |
protected void |
removeCache(java.lang.Exception e)
Remove the cachestream and the cache entry. |
static void |
setup(java.util.Properties prop)
Setup this class. |
protected void |
tryconvert()
Try to convert the image. |
protected void |
writeHeader()
Write the response header |
| Methods inherited from class rabbit.handler.BaseHandler |
finishStream, handle, prepareStream, send, setPartialContent |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public ImageHandler(Connection con,
HTTPHeader request,
HTTPHeader response,
java.io.InputStream contentstream,
MultiOutputStream clientstream,
boolean maycache,
boolean mayfilter,
long size)
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 |
protected void readImage()
throws java.io.IOException
java.io.IOException - if reading of the image fails.
protected void convertImage()
throws java.io.IOException
java.io.IOException - if conversion fails.
protected void tryconvert()
throws java.io.IOException
java.io.IOException
protected void writeHeader()
throws java.io.IOException
writeHeader in class BaseHandlerjava.io.IOException - if writing the response fails.
public void addCacheStream()
throws java.io.IOException
addCacheStream in class BaseHandlerjava.io.IOException - if a cachestream couldnt be set up.
protected void finish()
throws java.io.IOException
finish in class BaseHandlerjava.io.IOException - if cleaning fails.protected void removeCache(java.lang.Exception e)
removeCache in class BaseHandlere - the Exception that happenedpublic static void setup(java.util.Properties prop)
prop - the properties of this class.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||