Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.base.util.compression
Class CompressingStreamFactory

java.lang.Object
  extended by com.jivesoftware.base.util.compression.CompressingStreamFactory

public abstract class CompressingStreamFactory
extends java.lang.Object

Implementations of this abstract class can add compression of a particular type to a given OutputStream. They each return a CompressingOutputStream, which is just a thin wrapper on top of an OutputStream that adds the ability to "finish" a stream (see CompressingOutputStream).

This class contains implementations based on several popular compression algorithms, such as gzip. For example, the gzip implementation can decorate an OutputStream using an instance of GZIPOutputStream and in that way add gzip compression to the stream.


Field Summary
static java.lang.String COMPRESS_ENCODING
           
static java.lang.String DEFLATE_ENCODING
           
static java.lang.String GZIP_ENCODING
           
static java.lang.String NO_ENCODING
          "No encoding" content type: "identity".
static java.lang.String X_COMPRESS_ENCODING
           
static java.lang.String X_GZIP_ENCODING
           
 
Constructor Summary
CompressingStreamFactory()
           
 
Method Summary
static java.lang.String getBestContentEncoding(javax.servlet.http.HttpServletRequest httpRequest)
          Determines best content encoding for the response, based on the request -- in particular, based on its "Accept-Encoding" header.
abstract  com.jivesoftware.base.util.compression.CompressingOutputStream getCompressingStream(java.io.OutputStream servletOutputStream, JiveCompressionFilterContext context)
           
static CompressingStreamFactory getFactoryForContentEncoding(java.lang.String contentEncoding)
          Returns the CompressingStreamFactory instance associated to the given content encoding.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NO_ENCODING

public static final java.lang.String NO_ENCODING
"No encoding" content type: "identity".

See Also:
Constant Field Values

GZIP_ENCODING

public static final java.lang.String GZIP_ENCODING
See Also:
Constant Field Values

X_GZIP_ENCODING

public static final java.lang.String X_GZIP_ENCODING
See Also:
Constant Field Values

DEFLATE_ENCODING

public static final java.lang.String DEFLATE_ENCODING
See Also:
Constant Field Values

COMPRESS_ENCODING

public static final java.lang.String COMPRESS_ENCODING
See Also:
Constant Field Values

X_COMPRESS_ENCODING

public static final java.lang.String X_COMPRESS_ENCODING
See Also:
Constant Field Values
Constructor Detail

CompressingStreamFactory

public CompressingStreamFactory()
Method Detail

getCompressingStream

public abstract com.jivesoftware.base.util.compression.CompressingOutputStream getCompressingStream(java.io.OutputStream servletOutputStream,
                                                                                                    JiveCompressionFilterContext context)
                                                                                             throws java.io.IOException
Throws:
java.io.IOException

getFactoryForContentEncoding

public static CompressingStreamFactory getFactoryForContentEncoding(java.lang.String contentEncoding)
Returns the CompressingStreamFactory instance associated to the given content encoding.

Parameters:
contentEncoding - content encoding (e.g. "gzip")
Returns:
CompressingStreamFactory for content encoding

getBestContentEncoding

public static java.lang.String getBestContentEncoding(javax.servlet.http.HttpServletRequest httpRequest)
Determines best content encoding for the response, based on the request -- in particular, based on its "Accept-Encoding" header.

Parameters:
httpRequest - request
Returns:
best content encoding

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.