|
||||||||||
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 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 java.lang.String |
createURL(org.apache.camel.Exchange exchange,
HttpEndpoint endpoint)
Creates the URL to invoke. |
static java.lang.Object |
deserializeJavaObjectFromStream(java.io.InputStream is)
Deserializes the input stream to a Java object |
static java.lang.Object |
readResponseBodyFromInputStream(java.io.InputStream is,
org.apache.camel.Exchange exchange)
Reads the response body from the given input stream. |
static java.lang.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(java.lang.String contentType,
org.apache.camel.Exchange exchange)
|
static void |
writeObjectToServletResponse(javax.servlet.ServletResponse response,
java.lang.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(java.io.OutputStream stream,
java.lang.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(java.lang.String contentType, org.apache.camel.Exchange exchange)
public static void writeObjectToServletResponse(javax.servlet.ServletResponse response, java.lang.Object target) throws java.io.IOException
HttpConstants.CONTENT_TYPE_JAVA_SERIALIZED_OBJECT
response
- servlet responsetarget
- object to write
java.io.IOException
- is thrown if error writingpublic static void writeObjectToStream(java.io.OutputStream stream, java.lang.Object target) throws java.io.IOException
stream
- output streamtarget
- object to write
java.io.IOException
- is thrown if error writingpublic static java.lang.Object deserializeJavaObjectFromStream(java.io.InputStream is) throws java.lang.ClassNotFoundException, java.io.IOException
is
- input stream for the Java object
java.lang.ClassNotFoundException
- is thrown if class not found
java.io.IOException
- can be thrownpublic static java.lang.Object readResponseBodyFromServletRequest(javax.servlet.http.HttpServletRequest request, org.apache.camel.Exchange exchange) throws java.io.IOException
request
- http servlet requestexchange
- the exchange
java.io.IOException
- is thrown if error reading response bodypublic static java.lang.Object readResponseBodyFromInputStream(java.io.InputStream is, org.apache.camel.Exchange exchange) throws java.io.IOException
is
- the input streamexchange
- the exchange
java.io.IOException
- is thrown if error reading response bodypublic static java.lang.String createURL(org.apache.camel.Exchange exchange, HttpEndpoint endpoint)
exchange
- the exchangeendpoint
- the endpoint
public static HttpMethods createMethod(org.apache.camel.Exchange exchange, HttpEndpoint endpoint, boolean hasPayload)
exchange
- the exchange
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |