public class InMemoryResponse extends HttpServletResponseWrapper implements Serializable
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 |
---|
InMemoryResponse(HttpServletResponse response,
OutputStream baos) |
Modifier and Type | Method and Description |
---|---|
void |
addCookie(Cookie cookie) |
void |
addDateHeader(String s,
long l) |
void |
addHeader(String s,
String s2) |
void |
addIntHeader(String s,
int i) |
boolean |
containsHeader(String s) |
void |
flushBuffer() |
int |
getContentLength() |
String |
getContentType() |
Collection<Cookie> |
getCookies() |
String |
getHeader(String s) |
Collection<String> |
getHeaderNames() |
Map<String,List<Serializable>> |
getHeaders() |
Collection<String> |
getHeaders(String s) |
ServletOutputStream |
getOutputStream() |
int |
getStatus() |
PrintWriter |
getWriter() |
void |
reset() |
void |
sendError(int i) |
void |
sendError(int i,
String s) |
void |
sendRedirect(String s) |
void |
setContentLength(int i) |
void |
setContentType(String s) |
void |
setDateHeader(String s,
long l) |
void |
setHeader(String s,
String s2) |
void |
setIntHeader(String s,
int i) |
void |
setStatus(int i) |
void |
setStatus(int i,
String s) |
encodeRedirectUrl, encodeRedirectURL, encodeUrl, encodeURL
getBufferSize, getCharacterEncoding, getLocale, getResponse, isCommitted, isWrapperFor, isWrapperFor, resetBuffer, setBufferSize, setCharacterEncoding, setLocale, setResponse
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getBufferSize, getCharacterEncoding, getLocale, isCommitted, resetBuffer, setBufferSize, setCharacterEncoding, setLocale
public InMemoryResponse(HttpServletResponse response, OutputStream baos)
public void addCookie(Cookie cookie)
addCookie
in interface HttpServletResponse
addCookie
in class HttpServletResponseWrapper
public void addDateHeader(String s, long l)
addDateHeader
in interface HttpServletResponse
addDateHeader
in class HttpServletResponseWrapper
public void addHeader(String s, String s2)
addHeader
in interface HttpServletResponse
addHeader
in class HttpServletResponseWrapper
public void addIntHeader(String s, int i)
addIntHeader
in interface HttpServletResponse
addIntHeader
in class HttpServletResponseWrapper
public boolean containsHeader(String s)
containsHeader
in interface HttpServletResponse
containsHeader
in class HttpServletResponseWrapper
public String getHeader(String s)
getHeader
in interface HttpServletResponse
getHeader
in class HttpServletResponseWrapper
public Collection<String> getHeaderNames()
getHeaderNames
in interface HttpServletResponse
getHeaderNames
in class HttpServletResponseWrapper
public Collection<String> getHeaders(String s)
getHeaders
in interface HttpServletResponse
getHeaders
in class HttpServletResponseWrapper
public int getStatus()
getStatus
in interface HttpServletResponse
getStatus
in class HttpServletResponseWrapper
public void sendError(int i) throws IOException
sendError
in interface HttpServletResponse
sendError
in class HttpServletResponseWrapper
IOException
public void sendError(int i, String s) throws IOException
sendError
in interface HttpServletResponse
sendError
in class HttpServletResponseWrapper
IOException
public void sendRedirect(String s) throws IOException
sendRedirect
in interface HttpServletResponse
sendRedirect
in class HttpServletResponseWrapper
IOException
public void setDateHeader(String s, long l)
setDateHeader
in interface HttpServletResponse
setDateHeader
in class HttpServletResponseWrapper
public void setHeader(String s, String s2)
setHeader
in interface HttpServletResponse
setHeader
in class HttpServletResponseWrapper
public void setIntHeader(String s, int i)
setIntHeader
in interface HttpServletResponse
setIntHeader
in class HttpServletResponseWrapper
public void setStatus(int i)
setStatus
in interface HttpServletResponse
setStatus
in class HttpServletResponseWrapper
public void setStatus(int i, String s)
setStatus
in interface HttpServletResponse
setStatus
in class HttpServletResponseWrapper
public String getContentType()
getContentType
in interface ServletResponse
getContentType
in class ServletResponseWrapper
public ServletOutputStream getOutputStream() throws IOException
getOutputStream
in interface ServletResponse
getOutputStream
in class ServletResponseWrapper
IOException
public PrintWriter getWriter() throws IOException
getWriter
in interface ServletResponse
getWriter
in class ServletResponseWrapper
IOException
public void reset()
reset
in interface ServletResponse
reset
in class ServletResponseWrapper
public void setContentLength(int i)
setContentLength
in interface ServletResponse
setContentLength
in class ServletResponseWrapper
public void setContentType(String s)
setContentType
in interface ServletResponse
setContentType
in class ServletResponseWrapper
public void flushBuffer() throws IOException
flushBuffer
in interface ServletResponse
flushBuffer
in class ServletResponseWrapper
IOException
public int getContentLength()
public Collection<Cookie> getCookies()
public Map<String,List<Serializable>> getHeaders()
Copyright © 2002–2018 The Apache Software Foundation. All rights reserved.