public final class AhcHelper extends Object
Modifier and Type | Method and Description |
---|---|
static URI |
createURI(org.apache.camel.Exchange exchange,
String url,
AhcEndpoint endpoint)
Creates the URI to invoke.
|
static String |
createURL(org.apache.camel.Exchange exchange,
AhcEndpoint endpoint)
Creates the URL to invoke.
|
static Object |
deserializeJavaObjectFromStream(InputStream is)
Deserializes the input stream to a Java object
|
static void |
setCharsetFromContentType(String contentType,
org.apache.camel.Exchange exchange) |
static void |
writeObjectToStream(OutputStream stream,
Object target)
Writes the given object as response body to the output stream
|
public static void writeObjectToStream(OutputStream stream, Object target) throws IOException
stream
- output streamtarget
- object to writeIOException
- is thrown if error writingpublic static Object deserializeJavaObjectFromStream(InputStream is) throws ClassNotFoundException, IOException
is
- input stream for the Java objectClassNotFoundException
- is thrown if class not foundIOException
- can be thrownpublic static void setCharsetFromContentType(String contentType, org.apache.camel.Exchange exchange)
public static String createURL(org.apache.camel.Exchange exchange, AhcEndpoint endpoint) throws URISyntaxException, UnsupportedEncodingException
exchange
- the exchangeendpoint
- the endpointURISyntaxException
- is thrown if the URL is invalidUnsupportedEncodingException
public static URI createURI(org.apache.camel.Exchange exchange, String url, AhcEndpoint endpoint) throws URISyntaxException
exchange
- the exchangeurl
- the url to invokeendpoint
- the endpointURISyntaxException
Apache Camel