com.jalios.rest.client
Class ClientUtil

java.lang.Object
  extended by com.jalios.rest.client.ClientUtil

public class ClientUtil
extends Object

Utility functions (static public methods) used in Rest Clients.

Since:
JCMS-6.0
Author:
dissert

Constructor Summary
ClientUtil()
           
 
Method Summary
static void addHttpHeader(org.restlet.data.Request request, String key, String value)
           
static org.jdom.Element getFirstElement(JcmsResource resource, String xpathExpression)
           
static List getNodeList(JcmsResource resource, String xpathExpression)
           
static org.restlet.data.Preference<org.restlet.data.MediaType> getPreferenceMediaType(org.restlet.data.MediaType mediaType)
           
static org.restlet.data.Request getRequest(org.restlet.data.Reference resourceRef, org.restlet.data.Method method)
          Instanciate the request with the uri and the HTTP method.
static Object getSingleNode(JcmsResource resource, String xpathExpression)
           
static void initCharlesProxy()
           
static void setPreferedMediaType(org.restlet.data.Request request, org.restlet.data.MediaType[] mediaTypes)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClientUtil

public ClientUtil()
Method Detail

addHttpHeader

public static void addHttpHeader(org.restlet.data.Request request,
                                 String key,
                                 String value)

getRequest

public static org.restlet.data.Request getRequest(org.restlet.data.Reference resourceRef,
                                                  org.restlet.data.Method method)
Instanciate the request with the uri and the HTTP method.

Parameters:
resourceRef -
method -
Returns:
the Request object, with the URI and the HTTP method.

initCharlesProxy

public static void initCharlesProxy()

setPreferedMediaType

public static void setPreferedMediaType(org.restlet.data.Request request,
                                        org.restlet.data.MediaType[] mediaTypes)

getPreferenceMediaType

public static org.restlet.data.Preference<org.restlet.data.MediaType> getPreferenceMediaType(org.restlet.data.MediaType mediaType)

getFirstElement

public static org.jdom.Element getFirstElement(JcmsResource resource,
                                               String xpathExpression)
                                        throws org.jdom.JDOMException
Throws:
org.jdom.JDOMException

getSingleNode

public static Object getSingleNode(JcmsResource resource,
                                   String xpathExpression)
                            throws org.jdom.JDOMException
Throws:
org.jdom.JDOMException

getNodeList

public static List getNodeList(JcmsResource resource,
                               String xpathExpression)
                        throws org.jdom.JDOMException
Throws:
org.jdom.JDOMException


Copyright © 2001-2007 Jalios SA. All Rights Reserved.