Class EntityUtils
java.lang.Object
org.apache.camel.component.as2.api.util.EntityUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringappendParameter(String headerString, String parameterName, String parameterValue) static StringGenerated a unique value for a Multipart boundary string.static ApplicationEntitycreateEDIEntity(byte[] ediMessage, org.apache.hc.core5.http.ContentType ediMessageContentType, String contentTransferEncoding, boolean isMainBody, String filename) static byte[]static InputStreamdecode(InputStream is, String encoding) static Stringstatic byte[]decodeTransferEncodingOfBodyPartContent(String bodyPartContent, org.apache.hc.core5.http.ContentType contentType, String bodyPartTransferEncoding) static byte[]static OutputStreamencode(OutputStream os, String encoding) static Stringstatic byte[]getContent(org.apache.hc.core5.http.HttpEntity entity) static org.apache.hc.core5.http.HttpEntitygetMessageEntity(org.apache.hc.core5.http.HttpMessage message) static booleanhasEntity(org.apache.hc.core5.http.HttpMessage message) static voidprintEntity(PrintStream out, org.apache.hc.core5.http.HttpEntity entity) static StringprintEntity(org.apache.hc.core5.http.HttpEntity entity) static voidsetMessageEntity(org.apache.hc.core5.http.HttpMessage message, org.apache.hc.core5.http.HttpEntity entity)
-
Method Details
-
createBoundaryValue
Generated a unique value for a Multipart boundary string.The boundary string is composed of the components: "----=_Part_<global_part_number>_<newly_created_object's_hashcode>.<current_time>"
The generated string contains only US-ASCII characters and hence is safe for use in RFC822 headers.
- Returns:
- The generated boundary string.
-
appendParameter
-
encode
public static String encode(String data, Charset charset, String encoding) throws org.apache.camel.CamelException - Throws:
org.apache.camel.CamelException
-
encode
- Throws:
org.apache.camel.CamelException
-
encode
public static OutputStream encode(OutputStream os, String encoding) throws org.apache.camel.CamelException - Throws:
org.apache.camel.CamelException
-
decode
public static String decode(String data, Charset charset, String encoding) throws org.apache.camel.CamelException, org.apache.commons.codec.DecoderException - Throws:
org.apache.camel.CamelExceptionorg.apache.commons.codec.DecoderException
-
decode
public static byte[] decode(byte[] data, String encoding) throws org.apache.camel.CamelException, org.apache.commons.codec.DecoderException - Throws:
org.apache.camel.CamelExceptionorg.apache.commons.codec.DecoderException
-
decode
public static InputStream decode(InputStream is, String encoding) throws org.apache.camel.CamelException - Throws:
org.apache.camel.CamelException
-
createEDIEntity
public static ApplicationEntity createEDIEntity(byte[] ediMessage, org.apache.hc.core5.http.ContentType ediMessageContentType, String contentTransferEncoding, boolean isMainBody, String filename) throws org.apache.camel.CamelException - Throws:
org.apache.camel.CamelException
-
getContent
public static byte[] getContent(org.apache.hc.core5.http.HttpEntity entity) -
hasEntity
public static boolean hasEntity(org.apache.hc.core5.http.HttpMessage message) -
getMessageEntity
public static org.apache.hc.core5.http.HttpEntity getMessageEntity(org.apache.hc.core5.http.HttpMessage message) -
setMessageEntity
public static void setMessageEntity(org.apache.hc.core5.http.HttpMessage message, org.apache.hc.core5.http.HttpEntity entity) -
decodeTransferEncodingOfBodyPartContent
public static byte[] decodeTransferEncodingOfBodyPartContent(String bodyPartContent, org.apache.hc.core5.http.ContentType contentType, String bodyPartTransferEncoding) throws org.apache.camel.CamelException, org.apache.commons.codec.DecoderException - Throws:
org.apache.camel.CamelExceptionorg.apache.commons.codec.DecoderException
-
printEntity
public static void printEntity(PrintStream out, org.apache.hc.core5.http.HttpEntity entity) throws IOException - Throws:
IOException
-
printEntity
- Throws:
IOException
-