org.apache.stanbol.contenthub.web.util
Class RestUtil

java.lang.Object
  extended by org.apache.stanbol.contenthub.web.util.RestUtil

public class RestUtil
extends java.lang.Object

Utility class for REST services


Field Summary
static java.util.Set<java.lang.String> supportedMediaTypes
           
 
Constructor Summary
RestUtil()
           
 
Method Summary
static javax.ws.rs.core.MediaType getAcceptedMediaType(javax.ws.rs.core.HttpHeaders headers)
           
static boolean isHTMLaccepted(javax.ws.rs.core.HttpHeaders headers)
           
static boolean isJSONaccepted(javax.ws.rs.core.HttpHeaders headers)
           
static java.lang.String nullify(java.lang.String parameter)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

supportedMediaTypes

public static final java.util.Set<java.lang.String> supportedMediaTypes
Constructor Detail

RestUtil

public RestUtil()
Method Detail

nullify

public static java.lang.String nullify(java.lang.String parameter)
Parameters:
parameter - parameter to be checked
Returns:
null if parameter has an empty content, otherwise trimmed parameter

isJSONaccepted

public static boolean isJSONaccepted(javax.ws.rs.core.HttpHeaders headers)

isHTMLaccepted

public static boolean isHTMLaccepted(javax.ws.rs.core.HttpHeaders headers)

getAcceptedMediaType

public static javax.ws.rs.core.MediaType getAcceptedMediaType(javax.ws.rs.core.HttpHeaders headers)


Copyright © 2011-2012 The Apache Software Foundation. All Rights Reserved.