|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.servlet.ServletResponseWrapper
javax.servlet.http.HttpServletResponseWrapper
org.eclipse.jetty.http.gzip.GzipResponseWrapper
public class GzipResponseWrapper
| Field Summary | |
|---|---|
static int |
DEFAULT_BUFFER_SIZE
|
static int |
DEFAULT_MIN_GZIP_SIZE
|
| Constructor Summary | |
|---|---|
GzipResponseWrapper(HttpServletRequest request,
HttpServletResponse response)
Instantiates a new gzip response wrapper. |
|
| Method Summary | |
|---|---|
void |
addHeader(String name,
String value)
The default behavior of this method is to return addHeader(String name, String value) on the wrapped response object. |
void |
finish()
Finish. |
void |
flushBuffer()
The default behavior of this method is to call flushBuffer() on the wrapped response object. |
ServletOutputStream |
getOutputStream()
The default behavior of this method is to return getOutputStream() on the wrapped response object. |
PrintWriter |
getWriter()
The default behavior of this method is to return getWriter() on the wrapped response object. |
protected GzipStream |
newGzipStream(HttpServletRequest request,
HttpServletResponse response,
long contentLength,
int bufferSize,
int minGzipSize)
Allows derived implementations to replace GzipStream implementation. |
protected PrintWriter |
newWriter(OutputStream out,
String encoding)
Allows derived implementations to replace PrintWriter implementation. |
void |
noGzip()
No gzip. |
void |
reset()
The default behavior of this method is to call reset() on the wrapped response object. |
void |
resetBuffer()
The default behavior of this method is to call resetBuffer() on the wrapped response object. |
void |
sendError(int sc)
The default behavior of this method is to call sendError(int sc) on the wrapped response object. |
void |
sendError(int sc,
String msg)
The default behavior of this method is to call sendError(int sc, String msg) on the wrapped response object. |
void |
sendRedirect(String location)
The default behavior of this method is to return sendRedirect(String location) on the wrapped response object. |
void |
setBufferSize(int bufferSize)
The default behavior of this method is to call setBufferSize(int size) on the wrapped response object. |
void |
setContentLength(int length)
The default behavior of this method is to call setContentLength(int len) on the wrapped response object. |
protected void |
setContentLength(long length)
|
void |
setContentType(String ct)
The default behavior of this method is to call setContentType(String type) on the wrapped response object. |
void |
setHeader(String name,
String value)
The default behavior of this method is to return setHeader(String name, String value) on the wrapped response object. |
void |
setIntHeader(String name,
int value)
The default behavior of this method is to call setIntHeader(String name, int value) on the wrapped response object. |
void |
setMimeTypes(Set<String> mimeTypes)
Sets the mime types. |
void |
setMinGzipSize(int minGzipSize)
Sets the min gzip size. |
void |
setStatus(int sc)
The default behavior of this method is to call setStatus(int sc) on the wrapped response object. |
void |
setStatus(int sc,
String sm)
The default behavior of this method is to call setStatus(int sc, String sm) on the wrapped response object. |
| Methods inherited from class javax.servlet.http.HttpServletResponseWrapper |
|---|
addCookie, addDateHeader, addIntHeader, containsHeader, encodeRedirectUrl, encodeRedirectURL, encodeUrl, encodeURL, setDateHeader |
| Methods inherited from class javax.servlet.ServletResponseWrapper |
|---|
getBufferSize, getCharacterEncoding, getContentType, getLocale, getResponse, isCommitted, setCharacterEncoding, setLocale, setResponse |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface javax.servlet.ServletResponse |
|---|
getBufferSize, getCharacterEncoding, getContentType, getLocale, isCommitted, setCharacterEncoding, setLocale |
| Field Detail |
|---|
public static int DEFAULT_BUFFER_SIZE
public static int DEFAULT_MIN_GZIP_SIZE
| Constructor Detail |
|---|
public GzipResponseWrapper(HttpServletRequest request,
HttpServletResponse response)
request - the requestresponse - the response| Method Detail |
|---|
public void setMimeTypes(Set<String> mimeTypes)
mimeTypes - the new mime typespublic void setBufferSize(int bufferSize)
ServletResponseWrapper
setBufferSize in interface ServletResponsesetBufferSize in class ServletResponseWrapperbufferSize - the preferred buffer sizeServletResponseWrapper.setBufferSize(int)public void setMinGzipSize(int minGzipSize)
minGzipSize - the new min gzip sizepublic void setContentType(String ct)
ServletResponseWrapper
setContentType in interface ServletResponsesetContentType in class ServletResponseWrapperct - a String specifying the MIME
type of the contentServletResponseWrapper.setContentType(java.lang.String)
public void setStatus(int sc,
String sm)
HttpServletResponseWrapper
setStatus in interface HttpServletResponsesetStatus in class HttpServletResponseWrappersc - the status codesm - the status messageHttpServletResponseWrapper.setStatus(int, java.lang.String)public void setStatus(int sc)
HttpServletResponseWrapper
setStatus in interface HttpServletResponsesetStatus in class HttpServletResponseWrappersc - the status codeHttpServletResponseWrapper.setStatus(int)public void setContentLength(int length)
ServletResponseWrapper
setContentLength in interface ServletResponsesetContentLength in class ServletResponseWrapperlength - an integer specifying the length of the
content being returned to the client; sets
the Content-Length headerServletResponseWrapper.setContentLength(int)protected void setContentLength(long length)
public void addHeader(String name,
String value)
HttpServletResponseWrapper
addHeader in interface HttpServletResponseaddHeader in class HttpServletResponseWrappername - the name of the headervalue - the additional header value If it contains
octet string, it should be encoded
according to RFC 2047
(http://www.ietf.org/rfc/rfc2047.txt)HttpServletResponseWrapper.addHeader(java.lang.String, java.lang.String)
public void setHeader(String name,
String value)
HttpServletResponseWrapper
setHeader in interface HttpServletResponsesetHeader in class HttpServletResponseWrappername - the name of the headervalue - the header value If it contains octet string,
it should be encoded according to RFC 2047
(http://www.ietf.org/rfc/rfc2047.txt)HttpServletResponseWrapper.setHeader(java.lang.String, java.lang.String)
public void setIntHeader(String name,
int value)
HttpServletResponseWrapper
setIntHeader in interface HttpServletResponsesetIntHeader in class HttpServletResponseWrappername - the name of the headervalue - the assigned integer valueHttpServletResponseWrapper.setIntHeader(java.lang.String, int)
public void flushBuffer()
throws IOException
ServletResponseWrapper
flushBuffer in interface ServletResponseflushBuffer in class ServletResponseWrapperIOExceptionServletResponseWrapper.flushBuffer()public void reset()
ServletResponseWrapper
reset in interface ServletResponsereset in class ServletResponseWrapperServletResponseWrapper.reset()public void resetBuffer()
ServletResponseWrapper
resetBuffer in interface ServletResponseresetBuffer in class ServletResponseWrapperServletResponseWrapper.resetBuffer()
public void sendError(int sc,
String msg)
throws IOException
HttpServletResponseWrapper
sendError in interface HttpServletResponsesendError in class HttpServletResponseWrappersc - the error status codemsg - the descriptive message
IOException - If an input or output exception occursHttpServletResponseWrapper.sendError(int, java.lang.String)
public void sendError(int sc)
throws IOException
HttpServletResponseWrapper
sendError in interface HttpServletResponsesendError in class HttpServletResponseWrappersc - the error status code
IOException - If an input or output exception occursHttpServletResponseWrapper.sendError(int)
public void sendRedirect(String location)
throws IOException
HttpServletResponseWrapper
sendRedirect in interface HttpServletResponsesendRedirect in class HttpServletResponseWrapperlocation - the redirect location URL
IOException - If an input or output exception occursHttpServletResponseWrapper.sendRedirect(java.lang.String)
public ServletOutputStream getOutputStream()
throws IOException
ServletResponseWrapper
getOutputStream in interface ServletResponsegetOutputStream in class ServletResponseWrapperServletOutputStream for writing binary data
IOException - if an input or output exception occurredServletResponseWrapper.getOutputStream()
public PrintWriter getWriter()
throws IOException
ServletResponseWrapper
getWriter in interface ServletResponsegetWriter in class ServletResponseWrapperPrintWriter object that
can return character data to the client
IOException - if an input or output exception occurredServletResponseWrapper.getWriter()public void noGzip()
public void finish()
throws IOException
IOException - Signals that an I/O exception has occurred.
protected GzipStream newGzipStream(HttpServletRequest request,
HttpServletResponse response,
long contentLength,
int bufferSize,
int minGzipSize)
throws IOException
request - the requestresponse - the responsecontentLength - the content lengthbufferSize - the buffer sizeminGzipSize - the min gzip size
IOException - Signals that an I/O exception has occurred.
protected PrintWriter newWriter(OutputStream out,
String encoding)
throws UnsupportedEncodingException
out - the outencoding - the encoding
UnsupportedEncodingException - the unsupported encoding exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||