Returns the specified message as text.

@param message
the message
@param includeHeaders
specifies whether message headers are to be included in the returned text
@return the message text
974780
public static String messageAsText(final Message message, final boolean includeHeaders) {
		try {
			StrBuilder sb = new StrBuilder(300);

			if (includeHeaders) {
				@SuppressWarnings("unchecked")
				Enumeration<Header> headers = message.getAllHeaders();
				while (headers.hasMoreElements()) {
					Header header = headers.nextElement();
					sb.append(header.getName()).append('=').appendln(header.getValue());
				}

				sb.appendln("");
			}

			Object content = message.getContent();
			if (content instanceof String) {
				String body = (String) content;
				sb.appendln(body);
				sb.appendln("");
			} else if (content instanceof Multipart) {
				parseMultipart(sb, (Multipart) content);
			}
			return sb.toString();
		} catch (MessagingException ex) {
			throw new MailException("Error getting mail content.", ex);
		} catch (IOException ex) {
			throw new MailException("Error getting mail content.", ex);
		}
	}
91759
@Deprecated
    public static void removeHeader(HttpMessage message, CharSequence name) {
        message.headers().remove(name);
    }
1106575
public String getHeader(String name) {

		String nameToSearch = getCorrectHeaderName(name);
		String value = null;
		if (this.message.getHeader(nameToSearch) != null) {
			value = ((SIPHeader) this.message.getHeader(nameToSearch))
					.getValue();
		}
		if(logger.isDebugEnabled()) {
			logger.debug("getHeader "+ name+ ", value="+ value	);
		}
		return value;
	}
1356299
public static String getMessageJson(Object message) {
        VersionedMessage<?> versionedMessage = new VersionedMessage<>(CURRENT_MESSAGE_VERSION, message);

        return GSON.toJson(versionedMessage);
    }
71712
public static boolean isSpringInternalHeader(String headerName) {
        // "springintegration_" makes Citrus work with Spring Integration 1.x release
        if (headerName.startsWith("springintegration_")) {
            return true;
        } else if (headerName.equals(MessageHeaders.ID)) {
            return true;
        } else if (headerName.equals(MessageHeaders.TIMESTAMP)) {
            return true;
        } else if (headerName.equals(MessageHeaders.REPLY_CHANNEL)) {
            return true;
        } else if (headerName.equals(MessageHeaders.ERROR_CHANNEL)) {
            return true;
        } else if (headerName.equals(MessageHeaders.CONTENT_TYPE)) {
            return true;
        } else if (headerName.equals(IntegrationMessageHeaderAccessor.PRIORITY)) {
            return true;
        } else if (headerName.equals(IntegrationMessageHeaderAccessor.CORRELATION_ID)) {
            return true;
        } else if (headerName.equals(IntegrationMessageHeaderAccessor.ROUTING_SLIP)) {
            return true;
        } else if (headerName.equals(IntegrationMessageHeaderAccessor.DUPLICATE_MESSAGE)) {
            return true;
        } else if (headerName.equals(IntegrationMessageHeaderAccessor.SEQUENCE_NUMBER)) {
            return true;
        } else if (headerName.equals(IntegrationMessageHeaderAccessor.SEQUENCE_SIZE)) {
            return true;
        } else if (headerName.equals(IntegrationMessageHeaderAccessor.SEQUENCE_DETAILS)) {
            return true;
        } else if (headerName.equals(IntegrationMessageHeaderAccessor.EXPIRATION_DATE)) {
            return true;
        } else if (headerName.startsWith("jms_")) {
            return true;
        }

        return false;
    }
607376
protected UserMessage createTellMessage (BodyObject source, String message)
    {
        return UserMessage.create(source.getVisibleName(), message);
    }
933051
public static void showMessage(Component component, String message) {
		JOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(component), message,
				UIManager.getString("OptionPane.messageDialogTitle"),
				JOptionPane.INFORMATION_MESSAGE);
	}
565678
public static Messaging getMessaging(final Jaxb2Marshaller jaxb2Marshaller, final WebServiceMessage message) {

        SoapHeader soapHeader = ((SoapMessage) message).getSoapHeader();
        if (soapHeader == null) {
            throw new RuntimeException("The ebMS header is missing (no SOAP header found in SOAP request)");
        }

        Iterator<SoapHeaderElement> soapHeaderElementIterator = soapHeader.examineHeaderElements(MESSAGING_QNAME);
        if (!soapHeaderElementIterator.hasNext()) {
            throw new RuntimeException("The ebMS header is missing in SOAP header");
        }

        SoapHeaderElement incomingSoapHeaderElement = soapHeaderElementIterator.next();
        try {
            return (Messaging) jaxb2Marshaller.unmarshal(incomingSoapHeaderElement.getSource());
        } catch (Exception e) {
            throw new RuntimeException("The ebMs header failed to unmarshall");
        }

    }
1338769
public String getXML(boolean bIncludeHeader)
    {
        if (bIncludeHeader == false)
        {
            if (ManualMessage.MANUAL_MESSAGE_CODE.equals(this.get(TrxMessageHeader.MESSAGE_CODE)));
            {
                String strMessage = this.getString(ManualMessage.MESSAGE_PARAM);
                if (strMessage.startsWith("<"))
                    return strMessage;
            }
        }
        return super.getXML(bIncludeHeader);
    }
1237793
public static InboundMessageContext headers(Map<String, List<String>> newHeaders) {
        return getRequest().headers(newHeaders);
    }
292840
public String render(Collection<Message5WH> messages){
		StrBuilder ret = new StrBuilder(50);
		for(Message5WH msg : messages){
			ret.appendln(this.render(msg));
		}
		return ret.toString();
	}
435165
public static boolean isTransferEncodingChunked(HttpMessage message) {
        return message.headers().contains(HttpHeaderNames.TRANSFER_ENCODING, HttpHeaderValues.CHUNKED, true);
    }
1102997
public static String sputl(Object... messages) {
        CharBuf buf = CharBuf.create(100);
        return sputl(buf, messages).toString();
    }
696668
@Deprecated
    public static void addIntHeader(HttpMessage message, String name, int value) {
        message.headers().add(name, value);
    }
328670
public ResponseMessageBuilder headersWithDescription(Map<String, Header> headers) {
    this.headers.putAll(nullToEmptyMap(headers));
    return this;
  }
991494
public static function parseHeaders($content, AbstractMessage $message)
    {
        $namespace = explode('\\', get_class($message));
        $name = strtoupper(array_pop($namespace));

        if (strpos($content, 'HTTP/') === 0 || strpos($content, $name) === 0) {
            $line = self::nibbleLine($content);
            if (preg_match('/^HTTP\/[0-9]{1}\.[0-9]{1} (?P<code>[0-9]+) (?P<message>.*)$/', $line, $matches) &&
                $matches["code"] == "100"
            ) {
                self::nibbleLine($content);
            }
            while (($line = self::nibbleLine($content)) != "") {
                if (preg_match('/^([A-Za-z\-]+): (.*)/', $line, $matches)) {
                    $message->addHeader($matches[1], $matches[2]);
                }
            }
        }

        return $content;
    }
554661
public static String msgToString(SIBusMessage message)
   {
     if (message == null) return STRING_NULL;
     return message + "[" + message.getSystemMessageId() + "]";
   }