java.lang.Object |
↳ |
javax.servlet.ServletResponseWrapper |
|
↳ |
javax.servlet.http.HttpServletResponseWrapper |
|
|
↳ |
com.atlassian.jira.util.http.response.CapturingResponseWrapper |
Class Overview
This HttpServletResponseWrapper can capture an initial amount of response data and the headers/cookies that may be
set on the response.
THREAD SAFETY - One of these must be constructed on each HTTP request/response and hence only one thread may write to
it at the one time. This suits the whole servlet engine idea,
Summary
Nested Classes |
class |
CapturingResponseWrapper.HttpHeader |
This class represent the HTTP headers that have been output to this ResponseWrapper
|
[Expand]
Inherited Constants |
From interface
javax.servlet.http.HttpServletResponse
int |
SC_ACCEPTED |
|
int |
SC_BAD_GATEWAY |
|
int |
SC_BAD_REQUEST |
|
int |
SC_CONFLICT |
|
int |
SC_CONTINUE |
|
int |
SC_CREATED |
|
int |
SC_EXPECTATION_FAILED |
|
int |
SC_FORBIDDEN |
|
int |
SC_FOUND |
|
int |
SC_GATEWAY_TIMEOUT |
|
int |
SC_GONE |
|
int |
SC_HTTP_VERSION_NOT_SUPPORTED |
|
int |
SC_INTERNAL_SERVER_ERROR |
|
int |
SC_LENGTH_REQUIRED |
|
int |
SC_METHOD_NOT_ALLOWED |
|
int |
SC_MOVED_PERMANENTLY |
|
int |
SC_MOVED_TEMPORARILY |
|
int |
SC_MULTIPLE_CHOICES |
|
int |
SC_NON_AUTHORITATIVE_INFORMATION |
|
int |
SC_NOT_ACCEPTABLE |
|
int |
SC_NOT_FOUND |
|
int |
SC_NOT_IMPLEMENTED |
|
int |
SC_NOT_MODIFIED |
|
int |
SC_NO_CONTENT |
|
int |
SC_OK |
|
int |
SC_PARTIAL_CONTENT |
|
int |
SC_PAYMENT_REQUIRED |
|
int |
SC_PRECONDITION_FAILED |
|
int |
SC_PROXY_AUTHENTICATION_REQUIRED |
|
int |
SC_REQUESTED_RANGE_NOT_SATISFIABLE |
|
int |
SC_REQUEST_ENTITY_TOO_LARGE |
|
int |
SC_REQUEST_TIMEOUT |
|
int |
SC_REQUEST_URI_TOO_LONG |
|
int |
SC_RESET_CONTENT |
|
int |
SC_SEE_OTHER |
|
int |
SC_SERVICE_UNAVAILABLE |
|
int |
SC_SWITCHING_PROTOCOLS |
|
int |
SC_TEMPORARY_REDIRECT |
|
int |
SC_UNAUTHORIZED |
|
int |
SC_UNSUPPORTED_MEDIA_TYPE |
|
int |
SC_USE_PROXY |
|
|
Public Constructors |
|
CapturingResponseWrapper(HttpServletResponse httpServletResponse, int maxCaptureLen)
This will wrap the HttpServletResponse and capture up to maxCaptureLen of the response output.
|
[Expand]
Inherited Methods |
From class
javax.servlet.http.HttpServletResponseWrapper
void
|
addCookie(Cookie arg0)
|
void
|
addDateHeader(String arg0, long arg1)
|
void
|
addHeader(String arg0, String arg1)
|
void
|
addIntHeader(String arg0, int arg1)
|
boolean
|
containsHeader(String arg0)
|
String
|
encodeRedirectURL(String arg0)
|
String
|
encodeRedirectUrl(String arg0)
|
String
|
encodeURL(String arg0)
|
String
|
encodeUrl(String arg0)
|
void
|
sendError(int arg0, String arg1)
|
void
|
sendError(int arg0)
|
void
|
sendRedirect(String arg0)
|
void
|
setDateHeader(String arg0, long arg1)
|
void
|
setHeader(String arg0, String arg1)
|
void
|
setIntHeader(String arg0, int arg1)
|
void
|
setStatus(int arg0)
|
void
|
setStatus(int arg0, String arg1)
|
|
From class
javax.servlet.ServletResponseWrapper
void
|
flushBuffer()
|
int
|
getBufferSize()
|
String
|
getCharacterEncoding()
|
String
|
getContentType()
|
Locale
|
getLocale()
|
ServletOutputStream
|
getOutputStream()
|
ServletResponse
|
getResponse()
|
PrintWriter
|
getWriter()
|
boolean
|
isCommitted()
|
void
|
reset()
|
void
|
resetBuffer()
|
void
|
setBufferSize(int arg0)
|
void
|
setCharacterEncoding(String arg0)
|
void
|
setContentLength(int arg0)
|
void
|
setContentType(String arg0)
|
void
|
setLocale(Locale arg0)
|
void
|
setResponse(ServletResponse arg0)
|
|
From class
java.lang.Object
Object
|
clone()
|
boolean
|
equals(Object arg0)
|
void
|
finalize()
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait()
|
final
void
|
wait(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
|
From interface
javax.servlet.ServletResponse
void
|
flushBuffer()
|
int
|
getBufferSize()
|
String
|
getCharacterEncoding()
|
String
|
getContentType()
|
Locale
|
getLocale()
|
ServletOutputStream
|
getOutputStream()
|
PrintWriter
|
getWriter()
|
boolean
|
isCommitted()
|
void
|
reset()
|
void
|
resetBuffer()
|
void
|
setBufferSize(int arg0)
|
void
|
setCharacterEncoding(String arg0)
|
void
|
setContentLength(int arg0)
|
void
|
setContentType(String arg0)
|
void
|
setLocale(Locale arg0)
|
|
From interface
javax.servlet.http.HttpServletResponse
void
|
addCookie(Cookie arg0)
|
void
|
addDateHeader(String arg0, long arg1)
|
void
|
addHeader(String arg0, String arg1)
|
void
|
addIntHeader(String arg0, int arg1)
|
boolean
|
containsHeader(String arg0)
|
String
|
encodeRedirectURL(String arg0)
|
String
|
encodeRedirectUrl(String arg0)
|
String
|
encodeURL(String arg0)
|
String
|
encodeUrl(String arg0)
|
void
|
sendError(int arg0, String arg1)
|
void
|
sendError(int arg0)
|
void
|
sendRedirect(String arg0)
|
void
|
setDateHeader(String arg0, long arg1)
|
void
|
setHeader(String arg0, String arg1)
|
void
|
setIntHeader(String arg0, int arg1)
|
void
|
setStatus(int arg0)
|
void
|
setStatus(int arg0, String arg1)
|
|
Public Constructors
public
CapturingResponseWrapper
(HttpServletResponse httpServletResponse, int maxCaptureLen)
This will wrap the HttpServletResponse and capture up to maxCaptureLen of the response output.
Parameters
httpServletResponse
| the servlet response |
maxCaptureLen
| the maximum number of bytes to capture
|
Public Methods
public
void
addCookie
(Cookie cookie)
Overridden to capture cookie information.
public
void
addDateHeader
(String s, long l)
Overridden to capture HTTP header information
public
void
addHeader
(String s, String s1)
Overridden to capture HTTP header information
public
void
addIntHeader
(String s, int i)
public
byte[]
getBytes
()
This returns the bytes that have been captured on the ResponseWrapper.
Returns
- the bytes that have been captured on the ResponseWrapper
public
List
getCookieList
()
This returns a list of all the Cookie's that have been set on this response
Returns
- a list of all the Cookie's that have been set on this response
public
List
getHeaderList
()
public
ServletOutputStream
getOutputStream
()
public
void
setDateHeader
(String s, long l)
Overridden to capture HTTP header information
public
void
setHeader
(String s, String s1)
Overridden to capture HTTP header information
public
void
setIntHeader
(String s, int i)
Overridden to capture HTTP header information
public
int
size
()
This returns the number of bytes that have been captured so far.
Returns
- the the number of bytes that have been captured so far.