Class EntityUtils


  • public final class EntityUtils
    extends Object
    • Method Detail

      • createBoundaryValue

        public static String 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.
      • validateBoundaryValue

        public static boolean validateBoundaryValue​(String boundaryValue)
      • appendParameter

        public static String appendParameter​(String headerString,
                                             String parameterName,
                                             String parameterValue)
      • getContent

        public static byte[] getContent​(org.apache.http.HttpEntity entity)
      • hasEntity

        public static boolean hasEntity​(org.apache.http.HttpMessage message)
      • getMessageEntity

        public static org.apache.http.HttpEntity getMessageEntity​(org.apache.http.HttpMessage message)
      • setMessageEntity

        public static void setMessageEntity​(org.apache.http.HttpMessage message,
                                            org.apache.http.HttpEntity entity)
      • decodeTransferEncodingOfBodyPartContent

        public static byte[] decodeTransferEncodingOfBodyPartContent​(String bodyPartContent,
                                                                     org.apache.http.entity.ContentType contentType,
                                                                     String bodyPartTransferEncoding)
                                                              throws Exception
        Throws:
        Exception