Apache CXF API

org.apache.cxf.transport.http.gzip
Class GZIPInInterceptor

java.lang.Object
  extended by org.apache.cxf.phase.AbstractPhaseInterceptor<Message>
      extended by org.apache.cxf.transport.http.gzip.GZIPInInterceptor
All Implemented Interfaces:
Interceptor<Message>, PhaseInterceptor<Message>

public class GZIPInInterceptor
extends AbstractPhaseInterceptor<Message>

CXF interceptor that uncompresses those incoming messages that have "gzip" content-encoding. An instance of this class should be added as an in and inFault interceptor on clients that need to talk to a service that returns gzipped responses or on services that want to accept gzipped requests. For clients, you probably also want to use HTTPClientPolicy.setAcceptEncoding(java.lang.String) to let the server know you can handle compressed responses. To compress outgoing messages, see GZIPOutInterceptor. This class was originally based on one of the CXF samples (configuration_interceptor).

Author:
Ian Roberts (i.roberts@dcs.shef.ac.uk)

Nested Class Summary
 class GZIPInInterceptor.GZIPInEndingInterceptor
          Ending interceptor to restore the original input stream after processing, so as not to interfere with streaming HTTP.
 
Field Summary
static java.lang.String ORIGINAL_INPUT_STREAM_KEY
          Key under which we store the original input stream on the message, for use by the ending interceptor.
 
Constructor Summary
GZIPInInterceptor()
           
 
Method Summary
 void handleMessage(Message message)
          Intercepts a message.
 
Methods inherited from class org.apache.cxf.phase.AbstractPhaseInterceptor
addAfter, addAfter, addBefore, addBefore, getAfter, getBefore, getId, getPhase, handleFault, isGET, setAfter, setBefore
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ORIGINAL_INPUT_STREAM_KEY

public static final java.lang.String ORIGINAL_INPUT_STREAM_KEY
Key under which we store the original input stream on the message, for use by the ending interceptor.

Constructor Detail

GZIPInInterceptor

public GZIPInInterceptor()
Method Detail

handleMessage

public void handleMessage(Message message)
                   throws Fault
Description copied from interface: Interceptor
Intercepts a message. Interceptors should NOT invoke handleMessage or handleFault on the next interceptor - the interceptor chain will take care of this.

Throws:
Fault

Apache CXF API

Apache CXF