public final class NettyHttpHelper extends Object
| Modifier and Type | Method and Description |
|---|---|
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 boolean |
isStatusCodeOk(int statusCode,
String okStatusCodeRange)
Checks whether the given http status code is within the ok range
|
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) |
public static void setCharsetFromContentType(String contentType, org.apache.camel.Exchange exchange)
public static void appendHeader(Map<String,Object> headers, String key, Object value)
List that contains the multiple values.headers - headerskey - the keyvalue - the valuepublic static org.jboss.netty.handler.codec.http.HttpMethod createMethod(org.apache.camel.Message message,
boolean hasPayload)
HttpMethod to use to call the remote server, often either its GET or POST.message - the Camel messagepublic static Exception populateNettyHttpOperationFailedException(org.apache.camel.Exchange exchange, String url, org.jboss.netty.handler.codec.http.HttpResponse response, int responseCode, boolean transferException)
public static Object deserializeJavaObjectFromStream(InputStream is) throws ClassNotFoundException, IOException
ClassNotFoundExceptionIOExceptionpublic static String createURL(org.apache.camel.Exchange exchange, NettyHttpEndpoint endpoint) throws URISyntaxException
exchange - the exchangeendpoint - the endpointURISyntaxExceptionpublic static URI createURI(org.apache.camel.Exchange exchange, String url, NettyHttpEndpoint endpoint) throws URISyntaxException
exchange - the exchangeurl - the url to invokeendpoint - the endpointURISyntaxExceptionpublic static boolean isStatusCodeOk(int statusCode,
String okStatusCodeRange)
statusCode - the status codeokStatusCodeRange - the ok range (inclusive)Apache Camel