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 Summary
Fields Modifier and Type Field Description static StringATTRIBUTE_REST_RESOURCE_PATHThe Constant ATTRIBUTE_REST_RESOURCE_PATH. -
Constructor Summary
Constructors Constructor Description HttpRequestFacade() -
Method Summary
Modifier and Type Method Description static StringgetAttribute(String name)Returns the attribute as stringstatic StringgetAttributeNames()Returns the attribute names.static StringgetAuthType()Returns the auth type.static StringgetBytes()Returns the bytes.static StringgetCharacterEncoding()Returns the character encoding.static intgetContentLength()Returns the content length.static StringgetContentType()Returns the content type.static StringgetContextPath()Returns the context path.static StringgetCookies()Returns the cookies.static StringgetHeader(String name)Returns the value of the specified request header as a String.static StringgetHeaderNames()Returns the header names.static StringgetHeaders(String name)Returns the headers.static javax.servlet.ServletInputStreamgetInputStream()Returns the input stream.static StringgetLocalAddr()Returns the local addr.static StringgetLocale()Returns the locale.static StringgetLocalName()Returns the local name.static intgetLocalPort()Returns the local port.static StringgetMethod()Returns the name of the HTTP method with which this request in the current thread context was madestatic StringgetParameter(String name)Returns the parameter.static StringgetParameterNames()Returns the parameter names.static StringgetParameters()Returns the parameters.static StringgetParameterValues(String name)Returns the parameter values.static StringgetPathInfo()Returns any extra path information associated with the URL the client sent when it made this requeststatic StringgetPathTranslated()Returns any extra path information after the servlet name but before the query string, and translates it to a real pathstatic StringgetProtocol()Returns the protocol.static StringgetQueryString()Returns the query string.static StringgetRemoteAddress()Returns the remote address.static StringgetRemoteHost()Returns the remote host.static intgetRemotePort()Returns the remote port.static StringgetRemoteUser()Returns the login of the user making the request or null if the user hasn't been authenticatedstatic javax.servlet.http.HttpServletRequestgetRequest()Returns the request in the current thread contextstatic StringgetRequestURI()Returns the request URI.static StringgetRequestURL()Returns the request URL.static StringgetResourcePath()Returns the resource path.static StringgetScheme()Returns the scheme.static StringgetServerName()Returns the server name.static intgetServerPort()Returns the server port.static StringgetServicePath()Returns the service path.static StringgetText()Returns the text.static booleanisSecure()Checks if is secure.static booleanisUserInRole(String role)Checks if is user in role.static booleanisValid()Checks if there is a request in the current thread contextstatic voidremoveAttribute(String name)Removes the attribute.static voidsetAttribute(String name, String value)Sets the attribute.
-
Field Details
-
ATTRIBUTE_REST_RESOURCE_PATH
The Constant ATTRIBUTE_REST_RESOURCE_PATH.- See Also:
- Constant Field Values
-
-
Constructor Details
-
HttpRequestFacade
public HttpRequestFacade()
-
-
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
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
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
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
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
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
Checks if is user in role.- Parameters:
role- the role- Returns:
- true, if is user in role
- See Also:
HttpServletRequest.isUserInRole(String)
-
getAttribute
Returns the attribute as string- Parameters:
name- the name- Returns:
- the attribute
- See Also:
ServletRequest.getAttribute(String)
-
getAuthType
Returns the auth type.- Returns:
- the auth type
- See Also:
HttpServletRequest.getAuthType()
-
getCookies
Returns the cookies.- Returns:
- the cookies
-
getAttributeNames
Returns the attribute names.- Returns:
- the attribute names
-
getCharacterEncoding
Returns the character encoding.- Returns:
- the character encoding
-
getContentLength
public static final int getContentLength()Returns the content length.- Returns:
- the content length
-
getHeaders
Returns the headers.- Parameters:
name- the name- Returns:
- the headers
-
getContentType
Returns the content type.- Returns:
- the content type
-
getBytes
Returns the bytes.- Returns:
- the bytes
- Throws:
IOException- Signals that an I/O exception has occurred.
-
getText
Returns the text.- Returns:
- the text
- Throws:
IOException- Signals that an I/O exception has occurred.
-
getInputStream
Returns the input stream.- Returns:
- the input stream
- Throws:
IOException- Signals that an I/O exception has occurred.
-
getParameter
Returns the parameter.- Parameters:
name- the name- Returns:
- the parameter
-
getParameters
Returns the parameters.- Returns:
- the parameters
-
getResourcePath
Returns the resource path.- Returns:
- the resource path
-
getHeaderNames
Returns the header names.- Returns:
- the header names
-
getParameterNames
Returns the parameter names.- Returns:
- the parameter names
-
getParameterValues
Returns the parameter values.- Parameters:
name- the name- Returns:
- the parameter values
-
getProtocol
Returns the protocol.- Returns:
- the protocol
-
getScheme
Returns the scheme.- Returns:
- the scheme
-
getContextPath
Returns the context path.- Returns:
- the context path
-
getServerName
Returns the server name.- Returns:
- the server name
-
getServerPort
public static final int getServerPort()Returns the server port.- Returns:
- the server port
-
getQueryString
Returns the query string.- Returns:
- the query string
-
getRemoteAddress
Returns the remote address.- Returns:
- the remote address
-
getRemoteHost
Returns the remote host.- Returns:
- the remote host
-
setAttribute
Sets the attribute.- Parameters:
name- the namevalue- the value
-
removeAttribute
Removes the attribute.- Parameters:
name- the name
-
getLocale
Returns the locale.- Returns:
- the locale
-
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
Returns the request URL.- Returns:
- the request URL
-
getServicePath
Returns the service path.- Returns:
- the service path
-
getRemotePort
public static final int getRemotePort()Returns the remote port.- Returns:
- the remote port
-
getLocalName
Returns the local name.- Returns:
- the local name
-
getLocalAddr
Returns the local addr.- Returns:
- the local addr
-
getLocalPort
public static final int getLocalPort()Returns the local port.- Returns:
- the local port
-