Class UndertowHttpRequest

java.lang.Object
dev.voidframework.web.server.http.UndertowHttpRequest
All Implemented Interfaces:
HttpRequest

public final class UndertowHttpRequest extends Object implements HttpRequest
Undertow HttpRequest implementation.
  • Constructor Details

    • UndertowHttpRequest

      public UndertowHttpRequest(io.undertow.server.HttpServerExchange httpServerExchange, HttpRequestBodyContent httpRequestBodyContent)
      Build a new instance.
      Parameters:
      httpServerExchange - Current HTTP server exchange
      httpRequestBodyContent - Current HTTP request body content
  • Method Details

    • getCharset

      public String getCharset()
      Description copied from interface: HttpRequest
      Returns the request charset.
      Specified by:
      getCharset in interface HttpRequest
      Returns:
      The request charset
    • getCookie

      public Cookie getCookie(String cookieName)
      Description copied from interface: HttpRequest
      Returns a cookie.
      Specified by:
      getCookie in interface HttpRequest
      Parameters:
      cookieName - The cookie name
      Returns:
      The cookie, otherwise, null
    • acceptContentType

      public boolean acceptContentType(String contentType)
      Description copied from interface: HttpRequest
      Checks if the current request accept a specific content type.
      Specified by:
      acceptContentType in interface HttpRequest
      Parameters:
      contentType - The content type
      Returns:
      true if the content type is accepted, otherwise, false
    • getHeader

      public String getHeader(String headerName)
      Description copied from interface: HttpRequest
      Returns a single header.
      Specified by:
      getHeader in interface HttpRequest
      Parameters:
      headerName - The header name
      Returns:
      The requested header value, otherwise, a null value
    • getHeaders

      public Map<String,List<String>> getHeaders()
      Description copied from interface: HttpRequest
      Returns all headers.
      Specified by:
      getHeaders in interface HttpRequest
      Returns:
      All headers
    • getHttpMethod

      public HttpMethod getHttpMethod()
      Description copied from interface: HttpRequest
      Get the HTTP request method.
      Specified by:
      getHttpMethod in interface HttpRequest
      Returns:
      The request method
    • getInputSteam

      public InputStream getInputSteam()
      Description copied from interface: HttpRequest
      Get the input stream to read the request. Can only be called one time.
      Specified by:
      getInputSteam in interface HttpRequest
      Returns:
      The input stream
    • getQueryString

      public String getQueryString()
      Description copied from interface: HttpRequest
      Returns the query string, without the leading "?".
      Specified by:
      getQueryString in interface HttpRequest
      Returns:
      The query string
    • getQueryStringParameter

      public String getQueryStringParameter(String parameterName)
      Description copied from interface: HttpRequest
      Returns the query string parameter value.
      Specified by:
      getQueryStringParameter in interface HttpRequest
      Parameters:
      parameterName - The parameter name
      Returns:
      The query string parameter value
    • getQueryStringParameterAsList

      public List<String> getQueryStringParameterAsList(String parameterName)
      Description copied from interface: HttpRequest
      Returns the query string parameter values as list. If the parameter does not exist, an empty list will be returned.
      Specified by:
      getQueryStringParameterAsList in interface HttpRequest
      Parameters:
      parameterName - The parameter name
      Returns:
      The query string parameter values as list
    • getQueryStringParameters

      public Map<String,List<String>> getQueryStringParameters()
      Description copied from interface: HttpRequest
      Returns all query string parameters.
      Specified by:
      getQueryStringParameters in interface HttpRequest
      Returns:
      All query string parameters
    • getRemoteHostName

      public String getRemoteHostName()
      Description copied from interface: HttpRequest
      Returns the remote host that this request was sent to.
      Specified by:
      getRemoteHostName in interface HttpRequest
      Returns:
      The remote host name
    • getRequestURL

      public String getRequestURL()
      Description copied from interface: HttpRequest
      Returns the complete URL as seen by the user.
      Specified by:
      getRequestURL in interface HttpRequest
      Returns:
      The request URL
    • getRequestURI

      public String getRequestURI()
      Description copied from interface: HttpRequest
      Returns the original request URI. This is not decoded in any way, and does not include the query string.
      Specified by:
      getRequestURI in interface HttpRequest
      Returns:
      The request URI
    • getBodyContent

      public HttpRequestBodyContent getBodyContent()
      Description copied from interface: HttpRequest
      Returns the body content;
      Specified by:
      getBodyContent in interface HttpRequest
      Returns:
      The body content