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.
  • Field Summary

    Fields inherited from interface javax.servlet.http.HttpServletRequest

    BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH
  • Constructor Summary

    Constructors
    Constructor
    Description
    ReplacedStringBodyRequestWrapper(javax.servlet.http.HttpServletRequest request, String body, String contentType, Charset charset)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
     
    int
     
     
     
     
     
    javax.servlet.ServletInputStream
     
    int
     
     

    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
  • Constructor Details

    • ReplacedStringBodyRequestWrapper

      public ReplacedStringBodyRequestWrapper(javax.servlet.http.HttpServletRequest request, String body, String contentType, Charset charset)
  • Method Details

    • getContentLength

      public int getContentLength()
      Specified by:
      getContentLength in interface javax.servlet.ServletRequest
      Overrides:
      getContentLength in class javax.servlet.ServletRequestWrapper
    • getContentType

      public String getContentType()
      Specified by:
      getContentType in interface javax.servlet.ServletRequest
      Overrides:
      getContentType in class javax.servlet.ServletRequestWrapper
    • getHeader

      public String getHeader(String name)
      Specified by:
      getHeader in interface javax.servlet.http.HttpServletRequest
      Overrides:
      getHeader in class javax.servlet.http.HttpServletRequestWrapper
    • getHeaders

      public Enumeration<String> getHeaders(String name)
      Specified by:
      getHeaders in interface javax.servlet.http.HttpServletRequest
      Overrides:
      getHeaders in class javax.servlet.http.HttpServletRequestWrapper
    • getHeaderNames

      public Enumeration<String> getHeaderNames()
      Specified by:
      getHeaderNames in interface javax.servlet.http.HttpServletRequest
      Overrides:
      getHeaderNames in class javax.servlet.http.HttpServletRequestWrapper
    • getIntHeader

      public int getIntHeader(String name)
      Specified by:
      getIntHeader in interface javax.servlet.http.HttpServletRequest
      Overrides:
      getIntHeader in class javax.servlet.http.HttpServletRequestWrapper
    • getCharacterEncoding

      public String getCharacterEncoding()
      Specified by:
      getCharacterEncoding in interface javax.servlet.ServletRequest
      Overrides:
      getCharacterEncoding in class javax.servlet.ServletRequestWrapper
    • getReader

      public BufferedReader getReader() throws IOException
      Specified by:
      getReader in interface javax.servlet.ServletRequest
      Overrides:
      getReader in class javax.servlet.ServletRequestWrapper
      Throws:
      IOException
    • getInputStream

      public javax.servlet.ServletInputStream getInputStream() throws IOException
      Specified by:
      getInputStream in interface javax.servlet.ServletRequest
      Overrides:
      getInputStream in class javax.servlet.ServletRequestWrapper
      Throws:
      IOException
    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException