public class CompressionServletResponseWrapper
extends javax.servlet.http.HttpServletResponseWrapper
| Modifier and Type | Field and Description |
|---|---|
protected int |
compressionBuffer
The compression buffer size
|
protected String[] |
compressionMimeTypes
The mime types to compress
|
protected int |
compressionThreshold
The threshold number to compress
|
protected int |
debug
Debug level
|
protected static String |
info
Descriptive information about this Response implementation.
|
protected javax.servlet.http.HttpServletResponse |
origResponse
Original response
|
protected javax.servlet.ServletOutputStream |
stream
The ServletOutputStream that has been returned by
getOutputStream(), if any. |
protected PrintWriter |
writer
The PrintWriter that has been returned by
getWriter(), if any. |
SC_ACCEPTED, SC_BAD_GATEWAY, SC_BAD_REQUEST, SC_CONFLICT, SC_CONTINUE, SC_CREATED, SC_EXPECTATION_FAILED, SC_FORBIDDEN, SC_FOUND, SC_GATEWAY_TIMEOUT, SC_GONE, SC_HTTP_VERSION_NOT_SUPPORTED, SC_INTERNAL_SERVER_ERROR, SC_LENGTH_REQUIRED, SC_METHOD_NOT_ALLOWED, SC_MOVED_PERMANENTLY, SC_MOVED_TEMPORARILY, SC_MULTIPLE_CHOICES, SC_NO_CONTENT, SC_NON_AUTHORITATIVE_INFORMATION, SC_NOT_ACCEPTABLE, SC_NOT_FOUND, SC_NOT_IMPLEMENTED, SC_NOT_MODIFIED, SC_OK, SC_PARTIAL_CONTENT, SC_PAYMENT_REQUIRED, SC_PRECONDITION_FAILED, SC_PROXY_AUTHENTICATION_REQUIRED, SC_REQUEST_ENTITY_TOO_LARGE, SC_REQUEST_TIMEOUT, SC_REQUEST_URI_TOO_LONG, SC_REQUESTED_RANGE_NOT_SATISFIABLE, SC_RESET_CONTENT, SC_SEE_OTHER, SC_SERVICE_UNAVAILABLE, SC_SWITCHING_PROTOCOLS, SC_TEMPORARY_REDIRECT, SC_UNAUTHORIZED, SC_UNSUPPORTED_MEDIA_TYPE, SC_USE_PROXY| Constructor and Description |
|---|
CompressionServletResponseWrapper(javax.servlet.http.HttpServletResponse response)
Calls the parent constructor which creates a ServletResponse adaptor
wrapping the given response object.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addHeader(String name,
String value) |
javax.servlet.ServletOutputStream |
createOutputStream()
Create and return a ServletOutputStream to write the content
associated with this Response.
|
void |
finishResponse()
Finish a response.
|
void |
flushBuffer()
Flush the buffer and commit this response.
|
String |
getHeader(String name) |
javax.servlet.ServletOutputStream |
getOutputStream()
Return the servlet output stream associated with this Response.
|
PrintWriter |
getWriter()
Return the writer associated with this Response.
|
void |
setCompressionBuffer(int buffer)
Set compression buffer
|
void |
setCompressionMimeTypes(String[] mimeTypes)
Set compressible mime types
|
void |
setCompressionThreshold(int threshold)
Set threshold number
|
void |
setDebugLevel(int debug)
Set debug level
|
void |
setHeader(String name,
String value) |
addCookie, addDateHeader, addIntHeader, containsHeader, encodeRedirectUrl, encodeRedirectURL, encodeUrl, encodeURL, getHeaderNames, getHeaders, getStatus, sendError, sendError, sendRedirect, setDateHeader, setIntHeader, setStatus, setStatusgetBufferSize, getCharacterEncoding, getContentType, getLocale, getResponse, isCommitted, isWrapperFor, isWrapperFor, reset, resetBuffer, setBufferSize, setCharacterEncoding, setContentLength, setContentType, setLocale, setResponseprotected javax.servlet.http.HttpServletResponse origResponse
protected static final String info
protected javax.servlet.ServletOutputStream stream
getOutputStream(), if any.protected PrintWriter writer
getWriter(), if any.protected int compressionThreshold
protected int compressionBuffer
protected String[] compressionMimeTypes
protected int debug
public CompressionServletResponseWrapper(javax.servlet.http.HttpServletResponse response)
public void setCompressionThreshold(int threshold)
public void setCompressionBuffer(int buffer)
public void setCompressionMimeTypes(String[] mimeTypes)
public void setDebugLevel(int debug)
public javax.servlet.ServletOutputStream createOutputStream()
throws IOException
IOException - if an input/output error occurspublic void finishResponse()
public void flushBuffer()
throws IOException
flushBuffer in interface javax.servlet.ServletResponseflushBuffer in class javax.servlet.ServletResponseWrapperIOException - if an input/output error occurspublic javax.servlet.ServletOutputStream getOutputStream()
throws IOException
getOutputStream in interface javax.servlet.ServletResponsegetOutputStream in class javax.servlet.ServletResponseWrapperIllegalStateException - if getWriter has
already been called for this responseIOException - if an input/output error occurspublic PrintWriter getWriter() throws IOException
getWriter in interface javax.servlet.ServletResponsegetWriter in class javax.servlet.ServletResponseWrapperIllegalStateException - if getOutputStream has
already been called for this responseIOException - if an input/output error occurspublic String getHeader(String name)
getHeader in interface javax.servlet.http.HttpServletResponsegetHeader in class javax.servlet.http.HttpServletResponseWrapperpublic void addHeader(String name, String value)
addHeader in interface javax.servlet.http.HttpServletResponseaddHeader in class javax.servlet.http.HttpServletResponseWrapperCopyright © 2015 WSO2 Inc. All rights reserved.