Package org.vx68k.bitbucket.stub
Class StubHttpServletResponse
- java.lang.Object
-
- org.vx68k.bitbucket.stub.StubServletResponse
-
- org.vx68k.bitbucket.stub.StubHttpServletResponse
-
- All Implemented Interfaces:
HttpServletResponse
,ServletResponse
public class StubHttpServletResponse extends StubServletResponse implements HttpServletResponse
Stub implementation ofHttpServletResponse
.- Since:
- 5.0
- Author:
- Kaz Nishimura
-
-
Field Summary
-
Fields inherited from interface 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
-
-
Constructor Summary
Constructors Constructor Description StubHttpServletResponse(ServletOutputStream stream)
Constructs this object with aServletOutputStream
object.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addCookie(Cookie cookie)
void
addDateHeader(String name, long date)
void
addHeader(String name, String value)
void
addIntHeader(String name, int value)
boolean
containsHeader(String name)
String
encodeRedirectUrl(String url)
Deprecated.String
encodeRedirectURL(String url)
String
encodeUrl(String url)
Deprecated.String
encodeURL(String url)
String
getHeader(String name)
Collection<String>
getHeaderNames()
Collection<String>
getHeaders(String name)
int
getStatus()
void
sendError(int statusCode)
void
sendError(int statusCode, String message)
void
sendRedirect(String location)
void
setDateHeader(String name, long date)
void
setHeader(String name, String value)
void
setIntHeader(String name, int value)
void
setStatus(int value)
void
setStatus(int statusCode, String message)
Deprecated.-
Methods inherited from class org.vx68k.bitbucket.stub.StubServletResponse
checkNotCommitted, commit, flushBuffer, getBufferSize, getCharacterEncoding, getContentType, getLocale, getOutputStream, getWriter, isCommitted, reset, resetBuffer, setBufferSize, setCharacterEncoding, setContentLength, setContentLengthLong, setContentType, setLocale
-
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
flushBuffer, getBufferSize, getCharacterEncoding, getContentType, getLocale, getOutputStream, getWriter, isCommitted, reset, resetBuffer, setBufferSize, setCharacterEncoding, setContentLength, setContentLengthLong, setContentType, setLocale
-
-
-
-
Constructor Detail
-
StubHttpServletResponse
public StubHttpServletResponse(ServletOutputStream stream)
Constructs this object with aServletOutputStream
object.- Parameters:
stream
-ServletOutputStream
object
-
-
Method Detail
-
getStatus
public final int getStatus()
- Specified by:
getStatus
in interfaceHttpServletResponse
-
setStatus
public final void setStatus(int value)
- Specified by:
setStatus
in interfaceHttpServletResponse
-
setStatus
@Deprecated public final void setStatus(int statusCode, String message)
Deprecated.- Specified by:
setStatus
in interfaceHttpServletResponse
-
sendError
public final void sendError(int statusCode, String message) throws IOException
- Specified by:
sendError
in interfaceHttpServletResponse
- Throws:
IOException
-
sendError
public final void sendError(int statusCode) throws IOException
- Specified by:
sendError
in interfaceHttpServletResponse
- Throws:
IOException
-
sendRedirect
public final void sendRedirect(String location) throws IOException
- Specified by:
sendRedirect
in interfaceHttpServletResponse
- Throws:
IOException
-
addCookie
public void addCookie(Cookie cookie)
- Specified by:
addCookie
in interfaceHttpServletResponse
-
containsHeader
public boolean containsHeader(String name)
- Specified by:
containsHeader
in interfaceHttpServletResponse
-
encodeURL
public String encodeURL(String url)
This implementation always returns the given URL unchanged. Subclasses may override this method to return other values.
- Specified by:
encodeURL
in interfaceHttpServletResponse
- Parameters:
url
- URL to be encoded- Returns:
- the given URL unchanged
-
encodeRedirectURL
public String encodeRedirectURL(String url)
This implementation always returns the given URL unchanged. Subclasses may override this method to return other values.
- Specified by:
encodeRedirectURL
in interfaceHttpServletResponse
- Parameters:
url
- URL to be encoded- Returns:
- the given URL unchanged
-
encodeUrl
@Deprecated public final String encodeUrl(String url)
Deprecated.This implementation uses
encodeURL
internally.- Specified by:
encodeUrl
in interfaceHttpServletResponse
-
encodeRedirectUrl
@Deprecated public final String encodeRedirectUrl(String url)
Deprecated.This implementation uses
encodeRedirectURL
internally.- Specified by:
encodeRedirectUrl
in interfaceHttpServletResponse
-
setDateHeader
public void setDateHeader(String name, long date)
- Specified by:
setDateHeader
in interfaceHttpServletResponse
-
addDateHeader
public void addDateHeader(String name, long date)
- Specified by:
addDateHeader
in interfaceHttpServletResponse
-
setHeader
public void setHeader(String name, String value)
- Specified by:
setHeader
in interfaceHttpServletResponse
-
addHeader
public void addHeader(String name, String value)
- Specified by:
addHeader
in interfaceHttpServletResponse
-
setIntHeader
public void setIntHeader(String name, int value)
- Specified by:
setIntHeader
in interfaceHttpServletResponse
-
addIntHeader
public void addIntHeader(String name, int value)
- Specified by:
addIntHeader
in interfaceHttpServletResponse
-
getHeader
public String getHeader(String name)
- Specified by:
getHeader
in interfaceHttpServletResponse
-
getHeaders
public Collection<String> getHeaders(String name)
- Specified by:
getHeaders
in interfaceHttpServletResponse
-
getHeaderNames
public Collection<String> getHeaderNames()
- Specified by:
getHeaderNames
in interfaceHttpServletResponse
-
-