org.apache.camel.component.http.helper
Class GZIPHelper

java.lang.Object
  extended by org.apache.camel.component.http.helper.GZIPHelper

public final class GZIPHelper
extends Object

Helper/Utility class to help wrapping content into GZIP Input/Output Streams.


Field Summary
static String CONTENT_ENCODING
           
static String GZIP
           
 
Method Summary
static byte[] compressArrayIfGZIPRequested(String gzipEncoding, byte[] array)
           
static byte[] compressArrayIfGZIPRequested(String gzipEncoding, byte[] array, HttpServletResponse response)
           
static InputStream getGZIPWrappedInputStream(String gzipEncoding, InputStream inStream)
           
static ByteArrayOutputStream getGZIPWrappedOutputStream(byte[] array)
           
static InputStream getInputStream(org.apache.commons.httpclient.HttpMethod method)
           
static InputStream getInputStream(HttpServletRequest request)
           
static void setGZIPContentEncoding(HttpServletResponse response)
           
static void setGZIPMessageHeader(Message message)
           
static InputStream toGZIPInputStreamIfRequested(String gzipEncoding, byte[] array)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONTENT_ENCODING

public static final String CONTENT_ENCODING
See Also:
Constant Field Values

GZIP

public static final String GZIP
See Also:
Constant Field Values
Method Detail

setGZIPMessageHeader

public static void setGZIPMessageHeader(Message message)

setGZIPContentEncoding

public static void setGZIPContentEncoding(HttpServletResponse response)

getInputStream

public static InputStream getInputStream(org.apache.commons.httpclient.HttpMethod method)
                                  throws IOException
Throws:
IOException

getInputStream

public static InputStream getInputStream(HttpServletRequest request)
                                  throws IOException
Throws:
IOException

getGZIPWrappedInputStream

public static InputStream getGZIPWrappedInputStream(String gzipEncoding,
                                                    InputStream inStream)
                                             throws IOException
Throws:
IOException

toGZIPInputStreamIfRequested

public static InputStream toGZIPInputStreamIfRequested(String gzipEncoding,
                                                       byte[] array)
                                                throws Exception
Throws:
Exception

compressArrayIfGZIPRequested

public static byte[] compressArrayIfGZIPRequested(String gzipEncoding,
                                                  byte[] array)
                                           throws IOException
Throws:
IOException

compressArrayIfGZIPRequested

public static byte[] compressArrayIfGZIPRequested(String gzipEncoding,
                                                  byte[] array,
                                                  HttpServletResponse response)
                                           throws IOException
Throws:
IOException

getGZIPWrappedOutputStream

public static ByteArrayOutputStream getGZIPWrappedOutputStream(byte[] array)
                                                        throws IOException
Throws:
IOException


Copyright © 2009 Apache Software Foundation. All Rights Reserved.