Package org.apache.synapse.transport.netty.util

## Class MessageUtils

- java.lang.Object
- - org.apache.synapse.transport.netty.util.MessageUtils

-     public class MessageUtils
      extends Object

  Class MessageUtils contains helper methods that are used to build the payload.

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `MessageUtils()` |

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static void` | `buildMessage​(org.apache.axis2.context.MessageContext msgCtx)` |
    `static void` | `buildMessage​(org.apache.axis2.context.MessageContext msgCtx, boolean earlyBuild)` |
    `static org.apache.axis2.transport.MessageFormatter` | `getMessageFormatter​(org.apache.axis2.context.MessageContext msgContext)` | This selects the formatter for a given message format based on the the content type of the received message.
    `static String` | `getMIMEContentType​(String contentType)` | Get MIME content type out of content-type header.
    `static org.apache.axiom.om.OMOutputFormat` | `getOMOutputFormat​(org.apache.axis2.context.MessageContext msgContext)` |
    `static boolean` | `isEmptyPayloadStream​(InputStream inputStream)` | Function to check given inputstream is empty or not Used to check whether content of the payload input stream is empty or not.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### MessageUtils

          public MessageUtils()

  - ### Method Detail

    - #### buildMessage

          public static void buildMessage​(org.apache.axis2.context.MessageContext msgCtx)
                                   throws IOException

      Throws:
        `IOException`

    - #### buildMessage

          public static void buildMessage​(org.apache.axis2.context.MessageContext msgCtx,
                                          boolean earlyBuild)
                                   throws IOException

      Throws:
        `IOException`

    - #### getMIMEContentType

          public static String getMIMEContentType​(String contentType)

      Get MIME content type out of content-type header.
      Parameters:
        `contentType` - content type header value
      Returns:
        MIME content type

    - #### isEmptyPayloadStream

          public static boolean isEmptyPayloadStream​(InputStream inputStream)
                                              throws IOException

      Function to check given inputstream is empty or not Used to check whether content of the payload input stream is empty or not.
      Parameters:
        `inputStream` - target inputstream
      Returns:
        true if it is a empty stream
      Throws:
        `IOException`

    - #### getMessageFormatter

          public static org.apache.axis2.transport.MessageFormatter getMessageFormatter​(org.apache.axis2.context.MessageContext msgContext)

      This selects the formatter for a given message format based on the the content type of the received message. content-type to builder mapping can be specified through the Axis2.xml.
      Parameters:
        `msgContext` - axis2 MessageContext
      Returns:
        the formatter registered against the given content-type

    - #### getOMOutputFormat

          public static org.apache.axiom.om.OMOutputFormat getOMOutputFormat​(org.apache.axis2.context.MessageContext msgContext)