public final class RequestUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static io.undertow.util.AttachmentKey<Attachment> |
ATTACHMENT_KEY |
| Modifier and Type | Method and Description |
|---|---|
static Optional<com.github.scribejava.core.oauth.OAuthService> |
createOAuthService(OAuthProvider oAuthProvider)
Creates an OAuthService for authentication a user with OAuth
|
static Optional<OAuthProvider> |
getOAuthProvider(String oauth)
Returns an OAuthProvider based on a given string
|
static Map<String,String> |
getRequestParameters(io.undertow.server.HttpServerExchange exchange)
Converts request and query parameter into a single map
|
static String |
getServerSentEventURL(io.undertow.server.handlers.sse.ServerSentEventConnection connection)
Retrieves a URL from a Server-Sent Event connection
|
static String |
getWebSocketURL(io.undertow.websockets.core.WebSocketChannel channel)
Retrieves the URL of a WebSocketChannel
|
static boolean |
hasValidAuthentication(String cookieHeader)
Checks if the given header contains a valid authentication
|
static boolean |
isJsonRequest(io.undertow.server.HttpServerExchange exchange)
Checks if the requests content-type contains application/json
|
static boolean |
isPostOrPut(io.undertow.server.HttpServerExchange exchange)
Checks if the request is a POST or a PUT request
|
public static final io.undertow.util.AttachmentKey<Attachment> ATTACHMENT_KEY
public static Map<String,String> getRequestParameters(io.undertow.server.HttpServerExchange exchange)
exchange - The Undertow HttpServerExchangepublic static boolean isPostOrPut(io.undertow.server.HttpServerExchange exchange)
exchange - The Undertow HttpServerExchangepublic static boolean isJsonRequest(io.undertow.server.HttpServerExchange exchange)
exchange - The Undertow HttpServerExchangepublic static Optional<com.github.scribejava.core.oauth.OAuthService> createOAuthService(OAuthProvider oAuthProvider)
oAuthProvider - The OAuth provider Enumpublic static Optional<OAuthProvider> getOAuthProvider(String oauth)
oauth - The string to lookup the OAuthProvider Enumpublic static boolean hasValidAuthentication(String cookieHeader)
cookieHeader - The header to parsepublic static String getServerSentEventURL(io.undertow.server.handlers.sse.ServerSentEventConnection connection)
connection - The ServerSentEvent Connectionpublic static String getWebSocketURL(io.undertow.websockets.core.WebSocketChannel channel)
channel - The WebSocket ChannelCopyright © 2016. All rights reserved.