org.eclipse.jetty.http.gzip
类 CompressedResponseWrapper

java.lang.Object
  继承者 javax.servlet.ServletResponseWrapper
      继承者 javax.servlet.http.HttpServletResponseWrapper
          继承者 org.eclipse.jetty.http.gzip.CompressedResponseWrapper
所有已实现的接口:
HttpServletResponse, ServletResponse

public abstract class CompressedResponseWrapper
extends HttpServletResponseWrapper


字段摘要
protected  HttpServletRequest _request
           
static int DEFAULT_BUFFER_SIZE
           
static int DEFAULT_MIN_COMPRESS_SIZE
           
 
从接口 javax.servlet.http.HttpServletResponse 继承的字段
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
 
构造方法摘要
CompressedResponseWrapper(HttpServletRequest request, HttpServletResponse response)
           
 
方法摘要
 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.
 boolean containsHeader(String name)
          The default behavior of this method is to call containsHeader(String name) on the wrapped response object.
 void finish()
           
 void flushBuffer()
          The default behavior of this method is to call flushBuffer() on the wrapped response object.
 int getBufferSize()
          The default behavior of this method is to return getBufferSize() on the wrapped response object.
 long getContentLength()
           
 String getETag()
           
 int getMinCompressSize()
           
 ServletOutputStream getOutputStream()
          The default behavior of this method is to return getOutputStream() on the wrapped response object.
 HttpServletRequest getRequest()
           
 PrintWriter getWriter()
          The default behavior of this method is to return getWriter() on the wrapped response object.
protected abstract  AbstractCompressedStream newCompressedStream(HttpServletRequest _request, HttpServletResponse response)
           
protected  PrintWriter newWriter(OutputStream out, String encoding)
          Allows derived implementations to replace PrintWriter implementation.
 void noCompression()
           
 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)
           
 void setMinCompressSize(int minCompressSize)
           
 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.
 
从类 javax.servlet.http.HttpServletResponseWrapper 继承的方法
addCookie, addDateHeader, addIntHeader, encodeRedirectUrl, encodeRedirectURL, encodeUrl, encodeURL, getHeader, getHeaderNames, getHeaders, getStatus, setDateHeader
 
从类 javax.servlet.ServletResponseWrapper 继承的方法
getCharacterEncoding, getContentType, getLocale, getResponse, isCommitted, isWrapperFor, isWrapperFor, setCharacterEncoding, setLocale, setResponse
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
从接口 javax.servlet.ServletResponse 继承的方法
getCharacterEncoding, getContentType, getLocale, isCommitted, setCharacterEncoding, setLocale
 

字段详细信息

DEFAULT_BUFFER_SIZE

public static final int DEFAULT_BUFFER_SIZE
另请参见:
常量字段值

DEFAULT_MIN_COMPRESS_SIZE

public static final int DEFAULT_MIN_COMPRESS_SIZE
另请参见:
常量字段值

_request

protected HttpServletRequest _request
构造方法详细信息

CompressedResponseWrapper

public CompressedResponseWrapper(HttpServletRequest request,
                                 HttpServletResponse response)
方法详细信息

getContentLength

public long getContentLength()

getBufferSize

public int getBufferSize()
从类 ServletResponseWrapper 复制的描述
The default behavior of this method is to return getBufferSize() on the wrapped response object.

指定者:
接口 ServletResponse 中的 getBufferSize
覆盖:
ServletResponseWrapper 中的 getBufferSize
返回:
the actual buffer size used
另请参见:
ServletResponse.setBufferSize(int), ServletResponse.flushBuffer(), ServletResponse.isCommitted(), ServletResponse.reset()

getMinCompressSize

public int getMinCompressSize()

getETag

public String getETag()

getRequest

public HttpServletRequest getRequest()

setMimeTypes

public void setMimeTypes(Set<String> mimeTypes)
另请参见:
setMimeTypes(java.util.Set)

setBufferSize

public void setBufferSize(int bufferSize)
从类 ServletResponseWrapper 复制的描述
The default behavior of this method is to call setBufferSize(int size) on the wrapped response object.

指定者:
接口 ServletResponse 中的 setBufferSize
覆盖:
ServletResponseWrapper 中的 setBufferSize
参数:
bufferSize - the preferred buffer size
另请参见:
setBufferSize(int)

setMinCompressSize

public void setMinCompressSize(int minCompressSize)
另请参见:
setMinCompressSize(int)

setContentType

public void setContentType(String ct)
从类 ServletResponseWrapper 复制的描述
The default behavior of this method is to call setContentType(String type) on the wrapped response object.

指定者:
接口 ServletResponse 中的 setContentType
覆盖:
ServletResponseWrapper 中的 setContentType
参数:
ct - a String specifying the MIME type of the content
另请参见:
setContentType(java.lang.String)

setStatus

public void setStatus(int sc,
                      String sm)
从类 HttpServletResponseWrapper 复制的描述
The default behavior of this method is to call setStatus(int sc, String sm) on the wrapped response object.

指定者:
接口 HttpServletResponse 中的 setStatus
覆盖:
HttpServletResponseWrapper 中的 setStatus
参数:
sc - the status code
sm - the status message
另请参见:
setStatus(int, java.lang.String)

setStatus

public void setStatus(int sc)
从类 HttpServletResponseWrapper 复制的描述
The default behavior of this method is to call setStatus(int sc) on the wrapped response object.

指定者:
接口 HttpServletResponse 中的 setStatus
覆盖:
HttpServletResponseWrapper 中的 setStatus
参数:
sc - the status code
另请参见:
setStatus(int)

setContentLength

public void setContentLength(int length)
从类 ServletResponseWrapper 复制的描述
The default behavior of this method is to call setContentLength(int len) on the wrapped response object.

指定者:
接口 ServletResponse 中的 setContentLength
覆盖:
ServletResponseWrapper 中的 setContentLength
参数:
length - an integer specifying the length of the content being returned to the client; sets the Content-Length header
另请参见:
setContentLength(int)

setContentLength

protected void setContentLength(long length)

addHeader

public void addHeader(String name,
                      String value)
从类 HttpServletResponseWrapper 复制的描述
The default behavior of this method is to return addHeader(String name, String value) on the wrapped response object.

指定者:
接口 HttpServletResponse 中的 addHeader
覆盖:
HttpServletResponseWrapper 中的 addHeader
参数:
name - the name of the header
value - the additional header value If it contains octet string, it should be encoded according to RFC 2047 (http://www.ietf.org/rfc/rfc2047.txt)
另请参见:
addHeader(java.lang.String, java.lang.String)

flushBuffer

public void flushBuffer()
                 throws IOException
从类 ServletResponseWrapper 复制的描述
The default behavior of this method is to call flushBuffer() on the wrapped response object.

指定者:
接口 ServletResponse 中的 flushBuffer
覆盖:
ServletResponseWrapper 中的 flushBuffer
抛出:
IOException
另请参见:
flushBuffer()

reset

public void reset()
从类 ServletResponseWrapper 复制的描述
The default behavior of this method is to call reset() on the wrapped response object.

指定者:
接口 ServletResponse 中的 reset
覆盖:
ServletResponseWrapper 中的 reset
另请参见:
reset()

resetBuffer

public void resetBuffer()
从类 ServletResponseWrapper 复制的描述
The default behavior of this method is to call resetBuffer() on the wrapped response object.

指定者:
接口 ServletResponse 中的 resetBuffer
覆盖:
ServletResponseWrapper 中的 resetBuffer
另请参见:
resetBuffer()

sendError

public void sendError(int sc,
                      String msg)
               throws IOException
从类 HttpServletResponseWrapper 复制的描述
The default behavior of this method is to call sendError(int sc, String msg) on the wrapped response object.

指定者:
接口 HttpServletResponse 中的 sendError
覆盖:
HttpServletResponseWrapper 中的 sendError
参数:
sc - the error status code
msg - the descriptive message
抛出:
IOException - If an input or output exception occurs
另请参见:
sendError(int, java.lang.String)

sendError

public void sendError(int sc)
               throws IOException
从类 HttpServletResponseWrapper 复制的描述
The default behavior of this method is to call sendError(int sc) on the wrapped response object.

指定者:
接口 HttpServletResponse 中的 sendError
覆盖:
HttpServletResponseWrapper 中的 sendError
参数:
sc - the error status code
抛出:
IOException - If an input or output exception occurs
另请参见:
sendError(int)

sendRedirect

public void sendRedirect(String location)
                  throws IOException
从类 HttpServletResponseWrapper 复制的描述
The default behavior of this method is to return sendRedirect(String location) on the wrapped response object.

指定者:
接口 HttpServletResponse 中的 sendRedirect
覆盖:
HttpServletResponseWrapper 中的 sendRedirect
参数:
location - the redirect location URL
抛出:
IOException - If an input or output exception occurs
另请参见:
sendRedirect(java.lang.String)

noCompression

public void noCompression()
另请参见:
noCompression()

finish

public void finish()
            throws IOException
抛出:
IOException
另请参见:
finish()

setHeader

public void setHeader(String name,
                      String value)
从类 HttpServletResponseWrapper 复制的描述
The default behavior of this method is to return setHeader(String name, String value) on the wrapped response object.

指定者:
接口 HttpServletResponse 中的 setHeader
覆盖:
HttpServletResponseWrapper 中的 setHeader
参数:
name - the name of the header
value - the header value If it contains octet string, it should be encoded according to RFC 2047 (http://www.ietf.org/rfc/rfc2047.txt)
另请参见:
setHeader(java.lang.String, java.lang.String)

containsHeader

public boolean containsHeader(String name)
从类 HttpServletResponseWrapper 复制的描述
The default behavior of this method is to call containsHeader(String name) on the wrapped response object.

指定者:
接口 HttpServletResponse 中的 containsHeader
覆盖:
HttpServletResponseWrapper 中的 containsHeader
参数:
name - the header name
返回:
true if the named response header has already been set; false otherwise

getOutputStream

public ServletOutputStream getOutputStream()
                                    throws IOException
从类 ServletResponseWrapper 复制的描述
The default behavior of this method is to return getOutputStream() on the wrapped response object.

指定者:
接口 ServletResponse 中的 getOutputStream
覆盖:
ServletResponseWrapper 中的 getOutputStream
返回:
a ServletOutputStream for writing binary data
抛出:
IOException - if an input or output exception occurred
另请参见:
getOutputStream()

getWriter

public PrintWriter getWriter()
                      throws IOException
从类 ServletResponseWrapper 复制的描述
The default behavior of this method is to return getWriter() on the wrapped response object.

指定者:
接口 ServletResponse 中的 getWriter
覆盖:
ServletResponseWrapper 中的 getWriter
返回:
a PrintWriter object that can return character data to the client
抛出:
IOException - if an input or output exception occurred
另请参见:
getWriter()

setIntHeader

public void setIntHeader(String name,
                         int value)
从类 HttpServletResponseWrapper 复制的描述
The default behavior of this method is to call setIntHeader(String name, int value) on the wrapped response object.

指定者:
接口 HttpServletResponse 中的 setIntHeader
覆盖:
HttpServletResponseWrapper 中的 setIntHeader
参数:
name - the name of the header
value - the assigned integer value
另请参见:
setIntHeader(java.lang.String, int)

newWriter

protected PrintWriter newWriter(OutputStream out,
                                String encoding)
                         throws UnsupportedEncodingException
Allows derived implementations to replace PrintWriter implementation.

参数:
out - the out
encoding - the encoding
返回:
the prints the writer
抛出:
UnsupportedEncodingException - the unsupported encoding exception

newCompressedStream

protected abstract AbstractCompressedStream newCompressedStream(HttpServletRequest _request,
                                                                HttpServletResponse response)
                                                         throws IOException
返回:
the underlying CompressedStream implementation
抛出:
IOException


Copyright © 2013. All Rights Reserved.