Class ReplacedStringBodyRequestWrapper
- java.lang.Object
-
- javax.servlet.ServletRequestWrapper
-
- javax.servlet.http.HttpServletRequestWrapper
-
- com.atlassian.bamboo.plugins.rest.common.ReplacedStringBodyRequestWrapper
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,javax.servlet.http.HttpServletRequest
,javax.servlet.ServletRequest
public class ReplacedStringBodyRequestWrapper extends javax.servlet.http.HttpServletRequestWrapper implements Closeable
Wraps request substituting original request body for given string. Content type and charset must be provided.
-
-
Constructor Summary
Constructors Constructor Description ReplacedStringBodyRequestWrapper(javax.servlet.http.HttpServletRequest request, String body, String contentType, Charset charset)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
String
getCharacterEncoding()
int
getContentLength()
String
getContentType()
String
getHeader(String name)
Enumeration<String>
getHeaderNames()
Enumeration<String>
getHeaders(String name)
javax.servlet.ServletInputStream
getInputStream()
int
getIntHeader(String name)
BufferedReader
getReader()
-
Methods inherited from class javax.servlet.http.HttpServletRequestWrapper
authenticate, changeSessionId, getAuthType, getContextPath, getCookies, getDateHeader, getHttpServletMapping, getMethod, getPart, getParts, getPathInfo, getPathTranslated, getQueryString, getRemoteUser, getRequestedSessionId, getRequestURI, getRequestURL, getServletPath, getSession, getSession, getTrailerFields, getUserPrincipal, isRequestedSessionIdFromCookie, isRequestedSessionIdFromUrl, isRequestedSessionIdFromURL, isRequestedSessionIdValid, isTrailerFieldsReady, isUserInRole, login, logout, newPushBuilder, upgrade
-
Methods inherited from class javax.servlet.ServletRequestWrapper
getAsyncContext, getAttribute, getAttributeNames, getContentLengthLong, getDispatcherType, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getParameter, getParameterMap, getParameterNames, getParameterValues, getProtocol, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequest, getRequestDispatcher, getScheme, getServerName, getServerPort, getServletContext, isAsyncStarted, isAsyncSupported, isSecure, isWrapperFor, isWrapperFor, removeAttribute, setAttribute, setCharacterEncoding, setRequest, startAsync, startAsync
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface javax.servlet.ServletRequest
getAsyncContext, getAttribute, getAttributeNames, getContentLengthLong, getDispatcherType, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getParameter, getParameterMap, getParameterNames, getParameterValues, getProtocol, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequestDispatcher, getScheme, getServerName, getServerPort, getServletContext, isAsyncStarted, isAsyncSupported, isSecure, removeAttribute, setAttribute, setCharacterEncoding, startAsync, startAsync
-
-
-
-
Method Detail
-
getContentLength
public int getContentLength()
- Specified by:
getContentLength
in interfacejavax.servlet.ServletRequest
- Overrides:
getContentLength
in classjavax.servlet.ServletRequestWrapper
-
getContentType
public String getContentType()
- Specified by:
getContentType
in interfacejavax.servlet.ServletRequest
- Overrides:
getContentType
in classjavax.servlet.ServletRequestWrapper
-
getHeader
public String getHeader(String name)
- Specified by:
getHeader
in interfacejavax.servlet.http.HttpServletRequest
- Overrides:
getHeader
in classjavax.servlet.http.HttpServletRequestWrapper
-
getHeaders
public Enumeration<String> getHeaders(String name)
- Specified by:
getHeaders
in interfacejavax.servlet.http.HttpServletRequest
- Overrides:
getHeaders
in classjavax.servlet.http.HttpServletRequestWrapper
-
getHeaderNames
public Enumeration<String> getHeaderNames()
- Specified by:
getHeaderNames
in interfacejavax.servlet.http.HttpServletRequest
- Overrides:
getHeaderNames
in classjavax.servlet.http.HttpServletRequestWrapper
-
getIntHeader
public int getIntHeader(String name)
- Specified by:
getIntHeader
in interfacejavax.servlet.http.HttpServletRequest
- Overrides:
getIntHeader
in classjavax.servlet.http.HttpServletRequestWrapper
-
getCharacterEncoding
public String getCharacterEncoding()
- Specified by:
getCharacterEncoding
in interfacejavax.servlet.ServletRequest
- Overrides:
getCharacterEncoding
in classjavax.servlet.ServletRequestWrapper
-
getReader
public BufferedReader getReader() throws IOException
- Specified by:
getReader
in interfacejavax.servlet.ServletRequest
- Overrides:
getReader
in classjavax.servlet.ServletRequestWrapper
- Throws:
IOException
-
getInputStream
public javax.servlet.ServletInputStream getInputStream() throws IOException
- Specified by:
getInputStream
in interfacejavax.servlet.ServletRequest
- Overrides:
getInputStream
in classjavax.servlet.ServletRequestWrapper
- Throws:
IOException
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
-