public class RestUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
ADMIN_GROUP |
static int |
DEFAULT_LIMIT |
static int |
DEFAULT_OFFSET |
static int |
HARD_LIMIT |
static String |
SUPPORT_TYPE |
| Constructor and Description |
|---|
RestUtils() |
| Modifier and Type | Method and Description |
|---|---|
static DataEntity |
extractInfo(DataEntity inEntity,
List<String> returnedProperties) |
static String |
formatISO8601(Date date) |
static String |
getBaseRestUrl()
Get base url of rest service
|
static long |
getBaseTime(String baseDateTime) |
static String |
getBaseUrl()
Get base url of rest service
|
static Integer |
getIntegerValue(javax.ws.rs.core.UriInfo uriInfo,
String name) |
static javax.ws.rs.core.MediaType |
getJsonMediaType()
Gets the json media type
|
static int |
getLimit(javax.ws.rs.core.UriInfo uriInfo) |
static Long |
getLongValue(javax.ws.rs.core.UriInfo uriInfo,
String name) |
static javax.ws.rs.core.MediaType |
getMediaType(String expectedFormat,
String[] supportedFormats)
Gets the media type from an expected format string (usually the input) and an array of supported format strings.
|
static int |
getOffset(javax.ws.rs.core.UriInfo uriInfo) |
static String |
getPathParam(javax.ws.rs.core.UriInfo uriInfo,
String name) |
static String |
getQueryParam(javax.ws.rs.core.UriInfo uriInfo,
String name) |
static String |
getRestUrl(String type,
String id,
String restPath)
Get base url of rest service
|
static boolean |
isAnonymous()
Check if the current user is authenticated
|
static boolean |
isMemberOfAdminGroup()
Check if the authenticated user is a member of the admin group
|
static boolean |
isReturnSize(javax.ws.rs.core.UriInfo uriInfo) |
public static final int DEFAULT_LIMIT
public static final int DEFAULT_OFFSET
public static final int HARD_LIMIT
public static final String SUPPORT_TYPE
public static final String ADMIN_GROUP
public static javax.ws.rs.core.MediaType getJsonMediaType()
public static javax.ws.rs.core.MediaType getMediaType(String expectedFormat, String[] supportedFormats)
expectedFormat - the expected input formatsupportedFormats - the supported format arraypublic static boolean isMemberOfAdminGroup()
public static String getRestUrl(String type, String id, String restPath)
type - the type of rest serviceid - the id of objectpublic static String getBaseRestUrl()
public static String getBaseUrl()
public static boolean isAnonymous()
public static int getLimit(javax.ws.rs.core.UriInfo uriInfo)
public static int getOffset(javax.ws.rs.core.UriInfo uriInfo)
public static Integer getIntegerValue(javax.ws.rs.core.UriInfo uriInfo, String name)
public static boolean isReturnSize(javax.ws.rs.core.UriInfo uriInfo)
public static DataEntity extractInfo(DataEntity inEntity, List<String> returnedProperties)
public static long getBaseTime(String baseDateTime) throws ParseException
ParseExceptionCopyright © 2003–2020 eXo Platform SAS. All rights reserved.