com.ibm.wbi.protocol.http.beans
Class FixContentTypeEditor

com.ibm.wbi.Meg
  |
  +--com.ibm.wbi.Editor
        |
        +--com.ibm.wbi.protocol.http.HttpEditor
              |
              +--com.ibm.wbi.protocol.http.beans.FixContentTypeEditor

public class FixContentTypeEditor
extends HttpEditor

An Editor that modifies the reported content-type of a document to "image/gif" if the content appears to be a GIF image. This editor can be used to avoid confusion when a server mis-reports a document's content-type. It should be extended to detect other "magic numbers".


Field Summary
static java.lang.String COPYRIGHT
          IBM copyright information
 
Fields inherited from class com.ibm.wbi.Meg
EDITOR, GENERATOR, MONITOR, REQUEST_EDITOR, UNDEFINED
 
Constructor Summary
FixContentTypeEditor()
           
 
Method Summary
 void handleRequest(RequestEvent e)
          The method used by the proxy to edit the document header.
 
Methods inherited from class com.ibm.wbi.Editor
getType
 
Methods inherited from class com.ibm.wbi.Meg
forwardRequest, getCondition, getEnabled, getMegProperty, getMegProperty, getMegPropertyKeys, getName, getPlugin, getPriority, getSystemContext, initialize, initialize, isEnabled, isMegApplicable, loadMegResources, run, setCondition, setEnabled, setMegProperty, setName, setPriority, setSystemContext, setup, setup, setup, setup
 

Field Detail

COPYRIGHT

public static final java.lang.String COPYRIGHT
IBM copyright information
Constructor Detail

FixContentTypeEditor

public FixContentTypeEditor()
Method Detail

handleRequest

public void handleRequest(RequestEvent e)
                   throws RequestRejectedException,
                          java.io.IOException
The method used by the proxy to edit the document header. Note that this method does not alter documents if they have a response code other than 200 (Ok).
Overrides:
handleRequest in class HttpEditor
Following copied from class: com.ibm.wbi.protocol.http.HttpEditor
Parameters:
event - The request event with an input and output stream.
Throws:
RequestRejectedException - If rejecting request, this must be thrown before the first write() is made to the output stream.
java.io.Exception - can be thrown if an exception was generated by the Meg while processing the MegInput/OutputStreams.