org.apache.camel.component.netty.http
Class NettyHttpHelper

java.lang.Object
  extended by org.apache.camel.component.netty.http.NettyHttpHelper

public final class NettyHttpHelper
extends Object

Helpers.


Method Summary
static void appendHeader(Map<String,Object> headers, String key, Object value)
          Appends the key/value to the headers.
static org.jboss.netty.handler.codec.http.HttpMethod createMethod(org.apache.camel.Message message, boolean hasPayload)
          Creates the HttpMethod to use to call the remote server, often either its GET or POST.
static URI createURI(org.apache.camel.Exchange exchange, String url, NettyHttpEndpoint endpoint)
          Creates the URI to invoke.
static String createURL(org.apache.camel.Exchange exchange, NettyHttpEndpoint endpoint)
          Creates the URL to invoke.
static Object deserializeJavaObjectFromStream(InputStream is)
           
static String getCharsetFromContentType(String contentType)
           
static Exception populateNettyHttpOperationFailedException(org.apache.camel.Exchange exchange, String url, org.jboss.netty.handler.codec.http.HttpResponse response, int responseCode, boolean transferException)
           
static void setCharsetFromContentType(String contentType, org.apache.camel.Exchange exchange)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setCharsetFromContentType

public static void setCharsetFromContentType(String contentType,
                                             org.apache.camel.Exchange exchange)

getCharsetFromContentType

public static String getCharsetFromContentType(String contentType)

appendHeader

public static void appendHeader(Map<String,Object> headers,
                                String key,
                                Object value)
Appends the key/value to the headers.

This implementation supports keys with multiple values. In such situations the value will be a List that contains the multiple values.

Parameters:
headers - headers
key - the key
value - the value

createMethod

public static org.jboss.netty.handler.codec.http.HttpMethod createMethod(org.apache.camel.Message message,
                                                                         boolean hasPayload)
Creates the HttpMethod to use to call the remote server, often either its GET or POST.

Parameters:
message - the Camel message
Returns:
the created method

populateNettyHttpOperationFailedException

public static Exception populateNettyHttpOperationFailedException(org.apache.camel.Exchange exchange,
                                                                  String url,
                                                                  org.jboss.netty.handler.codec.http.HttpResponse response,
                                                                  int responseCode,
                                                                  boolean transferException)

deserializeJavaObjectFromStream

public static Object deserializeJavaObjectFromStream(InputStream is)
                                              throws ClassNotFoundException,
                                                     IOException
Throws:
ClassNotFoundException
IOException

createURL

public static String createURL(org.apache.camel.Exchange exchange,
                               NettyHttpEndpoint endpoint)
                        throws URISyntaxException
Creates the URL to invoke.

Parameters:
exchange - the exchange
endpoint - the endpoint
Returns:
the URL to invoke
Throws:
URISyntaxException

createURI

public static URI createURI(org.apache.camel.Exchange exchange,
                            String url,
                            NettyHttpEndpoint endpoint)
                     throws URISyntaxException
Creates the URI to invoke.

Parameters:
exchange - the exchange
url - the url to invoke
endpoint - the endpoint
Returns:
the URI to invoke
Throws:
URISyntaxException


Apache Camel