org.apache.synapse.transport.netty.util

## Class MessageUtils

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

-     public class MessageUtils
      extends java.lang.Object

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

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `MessageUtils()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and 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 java.lang.String` | `getMIMEContentType(java.lang.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(java.io.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 java.io.IOException

      Throws:
        `java.io.IOException`

    - #### buildMessage

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

      Throws:
        `java.io.IOException`

    - #### getMIMEContentType

          public static java.lang.String getMIMEContentType(java.lang.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(java.io.InputStream inputStream)
                                              throws java.io.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:
        `java.io.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)

Copyright © 2005-2022 Apache Software Foundation. All Rights Reserved.