public final class ContextHelper extends Object
Constructor and Description |
---|
ContextHelper() |
Modifier and Type | Method and Description |
---|---|
static Cookie |
getCookie(Collection<Cookie> cookies,
String name)
Get a specific cookie by its name.
|
static Cookie |
getCookie(WebContext context,
String name)
Get a specific cookie by its name.
|
static boolean |
isHttp(WebContext context)
Whether the request is HTTP.
|
static boolean |
isHttps(WebContext context)
Whether the request is HTTPS.
|
static boolean |
isHttpsOrSecure(WebContext context)
Whether the request is HTTPS or secure.
|
static boolean |
isPost(WebContext context)
Whether it is a POST request.
|
public static Cookie getCookie(Collection<Cookie> cookies, String name)
cookies
- provided cookiesname
- the name of the cookiepublic static Cookie getCookie(WebContext context, String name)
context
- the current web contextname
- the name of the cookiepublic static boolean isPost(WebContext context)
context
- the web contextpublic static boolean isHttpsOrSecure(WebContext context)
context
- the current web contextpublic static boolean isHttp(WebContext context)
context
- the current web contextpublic static boolean isHttps(WebContext context)
context
- the current web contextCopyright © 2016. All rights reserved.