public class Helpers
extends java.lang.Object
Constructor and Description |
---|
Helpers() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
formatDate(java.util.Date date) |
static java.util.Map<java.lang.String,java.lang.String> |
getJVMInfo() |
static java.util.Map<java.lang.String,java.lang.String> |
getOSInfo() |
static java.lang.String |
getQueryParameter(play.mvc.Http.Request request,
java.lang.String parameter)
Gets the value of to the given parameter in request's query string and trims whitespace.
|
static java.lang.String |
getQueryString(play.mvc.Http.Request request)
Returns the whole query string of the given Request including '?'.
|
static java.net.URL |
getRealBaseUrl(play.mvc.Http.Request request)
Returns the request's host URL with base path from 'play.http.context' but without the rest of the path
or query string (e.g.
|
static java.net.URL |
getRealHostUrl(play.mvc.Http.Request request)
Returns the request's host URL without path (and without base path from 'play.http.context') or query string
(e.g.
|
static java.lang.String |
humanReadableByteCount(long bytes) |
static java.lang.String |
humanReadableDuration(java.time.Duration duration) |
static void |
initializeAndUnproxy(java.lang.Object... objs)
Initialize all given objects that are loaded lazily in a Hibernate object
|
static <T> T |
initializeAndUnproxy(T obj)
Initialize an object that is loaded lazily in a Hibernate object
|
static java.lang.Boolean |
isAjax()
Check if the request was made via Ajax or not.
|
static boolean |
isAjax(play.api.mvc.RequestHeader request)
Check if the request was made via Ajax or not for Scala requests.
|
static boolean |
isAllowedSuperuser(User user) |
static boolean |
isLocalhost() |
static java.lang.String |
urlDecode(java.lang.String str) |
static java.lang.String |
urlEncode(java.lang.String str) |
public static boolean isAjax(play.api.mvc.RequestHeader request)
public static java.lang.Boolean isAjax()
public static java.net.URL getRealHostUrl(play.mvc.Http.Request request)
public static java.net.URL getRealBaseUrl(play.mvc.Http.Request request)
public static boolean isLocalhost()
public static java.lang.String urlEncode(java.lang.String str)
public static java.lang.String urlDecode(java.lang.String str)
public static java.lang.String getQueryParameter(play.mvc.Http.Request request, java.lang.String parameter)
public static java.lang.String getQueryString(play.mvc.Http.Request request)
public static java.lang.String humanReadableByteCount(long bytes)
public static java.util.Map<java.lang.String,java.lang.String> getJVMInfo()
public static java.util.Map<java.lang.String,java.lang.String> getOSInfo()
public static java.lang.String humanReadableDuration(java.time.Duration duration)
public static java.lang.String formatDate(java.util.Date date)
public static void initializeAndUnproxy(java.lang.Object... objs)
public static <T> T initializeAndUnproxy(T obj)
public static boolean isAllowedSuperuser(User user)