|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.camel.component.http.helper.HttpHelper
public final class HttpHelper
| Method Summary | |
|---|---|
static void |
appendHeader(Map<String,Object> headers,
String key,
Object value)
Appends the key/value to the headers. |
static HttpMethods |
createMethod(org.apache.camel.Exchange exchange,
HttpEndpoint endpoint,
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,
HttpEndpoint endpoint)
Creates the URI to invoke. |
static String |
createURL(org.apache.camel.Exchange exchange,
HttpEndpoint endpoint)
Creates the URL to invoke. |
static Object |
deserializeJavaObjectFromStream(InputStream is)
Deserializes the input stream to a Java object |
static Object |
extractHttpParameterValue(String value)
Extracts the parameter value. |
static String |
getCharsetFromContentType(String contentType)
|
static Object |
readResponseBodyFromInputStream(InputStream is,
org.apache.camel.Exchange exchange)
Reads the response body from the given input stream. |
static Object |
readResponseBodyFromServletRequest(javax.servlet.http.HttpServletRequest request,
org.apache.camel.Exchange exchange)
Reads the response body from the given http servlet request. |
static void |
setCharsetFromContentType(String contentType,
org.apache.camel.Exchange exchange)
|
static String |
urlRewrite(org.apache.camel.Exchange exchange,
String url,
HttpEndpoint endpoint,
org.apache.camel.Producer producer)
Processes any custom UrlRewrite. |
static void |
writeObjectToServletResponse(javax.servlet.ServletResponse response,
Object target)
Writes the given object as response body to the servlet response The content type will be set to HttpConstants.CONTENT_TYPE_JAVA_SERIALIZED_OBJECT |
static void |
writeObjectToStream(OutputStream stream,
Object target)
Writes the given object as response body to the output stream |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static void setCharsetFromContentType(String contentType,
org.apache.camel.Exchange exchange)
public static String getCharsetFromContentType(String contentType)
public static void writeObjectToServletResponse(javax.servlet.ServletResponse response,
Object target)
throws IOException
HttpConstants.CONTENT_TYPE_JAVA_SERIALIZED_OBJECT
response - servlet responsetarget - object to write
IOException - is thrown if error writing
public static void writeObjectToStream(OutputStream stream,
Object target)
throws IOException
stream - output streamtarget - object to write
IOException - is thrown if error writing
public static Object deserializeJavaObjectFromStream(InputStream is)
throws ClassNotFoundException,
IOException
is - input stream for the Java object
ClassNotFoundException - is thrown if class not found
IOException - can be thrown
public static Object readResponseBodyFromServletRequest(javax.servlet.http.HttpServletRequest request,
org.apache.camel.Exchange exchange)
throws IOException
request - http servlet requestexchange - the exchange
IOException - is thrown if error reading response body
public static Object readResponseBodyFromInputStream(InputStream is,
org.apache.camel.Exchange exchange)
throws IOException
is - the input streamexchange - the exchange
IOException - is thrown if error reading response body
public static String createURL(org.apache.camel.Exchange exchange,
HttpEndpoint endpoint)
exchange - the exchangeendpoint - the endpoint
public static URI createURI(org.apache.camel.Exchange exchange,
String url,
HttpEndpoint endpoint)
throws URISyntaxException
exchange - the exchangeurl - the url to invokeendpoint - the endpoint
URISyntaxException
public static HttpMethods createMethod(org.apache.camel.Exchange exchange,
HttpEndpoint endpoint,
boolean hasPayload)
throws URISyntaxException
exchange - the exchange
URISyntaxException
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 Object extractHttpParameterValue(String value)
List containing the values.
If the value is not a HTTP mulit value the value is returned as is.
value - the parameter value
public static String urlRewrite(org.apache.camel.Exchange exchange,
String url,
HttpEndpoint endpoint,
org.apache.camel.Producer producer)
throws Exception
UrlRewrite.
exchange - the exchangeurl - the urlendpoint - the http endpointproducer - the producer
Exception - is thrown if any error during rewriting url
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||