Package org.bpsbits.kt.rest.utils.brh
Class BrhKt
-
- All Implemented Interfaces:
public final class BrhKt
-
-
Field Summary
Fields Modifier and Type Field Description private final static StringclientIPprivate final static StringclientUserAgentprivate final static List<AcceptedLanguage>acceptedISO6391Languagesprivate final static StringfirstAcceptedISO6391Languageprivate final static StringtomcatSessionIdprivate final static AppInfoappInfo
-
Method Summary
Modifier and Type Method Description final StringgetClientIP()final StringgetClientUserAgent()final List<AcceptedLanguage>getAcceptedISO6391Languages()final StringgetFirstAcceptedISO6391Language()final StringgetTomcatSessionId()final AppInfogetAppInfo()final static StringcookieValue(BasicRequestHandler $self, String name, String default)Retrieves the value of the given cookie. final static NewCookienewCookie(BasicRequestHandler $self, String name, String value, Boolean httpOnly)Creates an entirely new cookie by utilising the given name and parameters. final static NewCookienewExpiredCookie(BasicRequestHandler $self, String name, Boolean httpOnly)Creates a new expired cookie with the given name. final static StringheaderValue(BasicRequestHandler $self, String name, String default)Returns the value for the given header. -
-
Method Detail
-
getClientIP
final String getClientIP()
-
getClientUserAgent
final String getClientUserAgent()
-
getAcceptedISO6391Languages
final List<AcceptedLanguage> getAcceptedISO6391Languages()
-
getFirstAcceptedISO6391Language
final String getFirstAcceptedISO6391Language()
-
getTomcatSessionId
final String getTomcatSessionId()
-
getAppInfo
final AppInfo getAppInfo()
-
cookieValue
final static String cookieValue(BasicRequestHandler $self, String name, String default)
Retrieves the value of the given cookie.
- Parameters:
name- The cookie's name.default- The value to return if the cookie does not exist.- Returns:
The value of the cookie. If no cookie is provided, an empty string is returned instead.
-
newCookie
final static NewCookie newCookie(BasicRequestHandler $self, String name, String value, Boolean httpOnly)
Creates an entirely new cookie by utilising the given name and parameters. It is automatically decided if the cookie should be only transmitted over an encrypted request using the HTTPS protocol.
- Parameters:
name- The cookie's name.value- The value of the cookie.httpOnly- Determines if JavaScript is prohibited from accessing the value of a cookie.- Returns:
The newly created cookie.
-
newExpiredCookie
final static NewCookie newExpiredCookie(BasicRequestHandler $self, String name, Boolean httpOnly)
Creates a new expired cookie with the given name. A cookie's expiration date is a signal to the browser that it should remove the cookie.
- Parameters:
name- The cookie's name.httpOnly- Determines if JavaScript is prohibited from accessing the value of a cookie.- Returns:
A new expired cookie.
-
headerValue
final static String headerValue(BasicRequestHandler $self, String name, String default)
Returns the value for the given header.
- Parameters:
name- The header's name.default- The value to return if the header isn't given- Returns:
The value for the given header.If no header is provided, an empty string is returned instead.
-
-
-
-