Class HttpRequestFacade

java.lang.Object
org.eclipse.dirigible.api.v3.http.HttpRequestFacade
All Implemented Interfaces:
IScriptingFacade

public class HttpRequestFacade
extends Object
implements IScriptingFacade
Java facade for working with HttpServletRequest
  • Field Details

  • Constructor Details

  • Method Details

    • getRequest

      public static final javax.servlet.http.HttpServletRequest getRequest()
      Returns the request in the current thread context
      Returns:
      the request
    • isValid

      public static final boolean isValid()
      Checks if there is a request in the current thread context
      Returns:
      true, if there is a request in the current thread context
    • getMethod

      public static final String getMethod()
      Returns the name of the HTTP method with which this request in the current thread context was made
      Returns:
      the HTTP method of the request
      See Also:
      HttpServletRequest.getMethod()
    • getRemoteUser

      public static final String getRemoteUser()
      Returns the login of the user making the request or null if the user hasn't been authenticated
      Returns:
      the login of the user making the request
      See Also:
      HttpServletRequest.getRemoteUser()
    • getPathInfo

      public static final String getPathInfo()
      Returns any extra path information associated with the URL the client sent when it made this request
      Returns:
      the path info
      See Also:
      HttpServletRequest.getPathInfo()
    • getPathTranslated

      public static final String getPathTranslated()
      Returns any extra path information after the servlet name but before the query string, and translates it to a real path
      Returns:
      the path translated
      See Also:
      HttpServletRequest.getPathTranslated()
    • getHeader

      public static final String getHeader​(String name)
      Returns the value of the specified request header as a String. If the request did not include a header of the specified name, this method returns null
      Parameters:
      name - the header name
      Returns:
      the header value
      See Also:
      HttpServletRequest.getHeader(String)
    • isUserInRole

      public static final boolean isUserInRole​(String role)
      Checks if is user in role.
      Parameters:
      role - the role
      Returns:
      true, if is user in role
      See Also:
      HttpServletRequest.isUserInRole(String)
    • getAttribute

      public static final String getAttribute​(String name)
      Returns the attribute as string
      Parameters:
      name - the name
      Returns:
      the attribute
      See Also:
      ServletRequest.getAttribute(String)
    • getAuthType

      public static final String getAuthType()
      Returns the auth type.
      Returns:
      the auth type
      See Also:
      HttpServletRequest.getAuthType()
    • getCookies

      public static final String getCookies()
      Returns the cookies.
      Returns:
      the cookies
    • getAttributeNames

      public static final String getAttributeNames()
      Returns the attribute names.
      Returns:
      the attribute names
    • getCharacterEncoding

      public static final String getCharacterEncoding()
      Returns the character encoding.
      Returns:
      the character encoding
    • getContentLength

      public static final int getContentLength()
      Returns the content length.
      Returns:
      the content length
    • getHeaders

      public static final String getHeaders​(String name)
      Returns the headers.
      Parameters:
      name - the name
      Returns:
      the headers
    • getContentType

      public static final String getContentType()
      Returns the content type.
      Returns:
      the content type
    • getBytes

      public static final String getBytes() throws IOException
      Returns the bytes.
      Returns:
      the bytes
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • getText

      public static final String getText() throws IOException
      Returns the text.
      Returns:
      the text
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • getInputStream

      public static final javax.servlet.ServletInputStream getInputStream() throws IOException
      Returns the input stream.
      Returns:
      the input stream
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • getParameter

      public static final String getParameter​(String name)
      Returns the parameter.
      Parameters:
      name - the name
      Returns:
      the parameter
    • getParameters

      public static final String getParameters()
      Returns the parameters.
      Returns:
      the parameters
    • getResourcePath

      public static final String getResourcePath()
      Returns the resource path.
      Returns:
      the resource path
    • getHeaderNames

      public static final String getHeaderNames()
      Returns the header names.
      Returns:
      the header names
    • getParameterNames

      public static final String getParameterNames()
      Returns the parameter names.
      Returns:
      the parameter names
    • getParameterValues

      public static final String getParameterValues​(String name)
      Returns the parameter values.
      Parameters:
      name - the name
      Returns:
      the parameter values
    • getProtocol

      public static final String getProtocol()
      Returns the protocol.
      Returns:
      the protocol
    • getScheme

      public static final String getScheme()
      Returns the scheme.
      Returns:
      the scheme
    • getContextPath

      public static final String getContextPath()
      Returns the context path.
      Returns:
      the context path
    • getServerName

      public static final String getServerName()
      Returns the server name.
      Returns:
      the server name
    • getServerPort

      public static final int getServerPort()
      Returns the server port.
      Returns:
      the server port
    • getQueryString

      public static final String getQueryString()
      Returns the query string.
      Returns:
      the query string
    • getRemoteAddress

      public static final String getRemoteAddress()
      Returns the remote address.
      Returns:
      the remote address
    • getRemoteHost

      public static final String getRemoteHost()
      Returns the remote host.
      Returns:
      the remote host
    • setAttribute

      public static final void setAttribute​(String name, String value)
      Sets the attribute.
      Parameters:
      name - the name
      value - the value
    • removeAttribute

      public static final void removeAttribute​(String name)
      Removes the attribute.
      Parameters:
      name - the name
    • getLocale

      public static final String getLocale()
      Returns the locale.
      Returns:
      the locale
    • getRequestURI

      public static final String getRequestURI()
      Returns the request URI.
      Returns:
      the request URI
    • isSecure

      public static final boolean isSecure()
      Checks if is secure.
      Returns:
      true, if is secure
    • getRequestURL

      public static final String getRequestURL()
      Returns the request URL.
      Returns:
      the request URL
    • getServicePath

      public static final String getServicePath()
      Returns the service path.
      Returns:
      the service path
    • getRemotePort

      public static final int getRemotePort()
      Returns the remote port.
      Returns:
      the remote port
    • getLocalName

      public static final String getLocalName()
      Returns the local name.
      Returns:
      the local name
    • getLocalAddr

      public static final String getLocalAddr()
      Returns the local addr.
      Returns:
      the local addr
    • getLocalPort

      public static final int getLocalPort()
      Returns the local port.
      Returns:
      the local port