Ejemplo n.º 1
0
 /**
  * Converts the message implementation into a String representation
  *
  * @param encoding The encoding to use when transforming the message (if necessary). The parameter
  *     is used when converting from a byte array
  * @return String representation of the message payload
  * @throws Exception Implementation may throw an endpoint specific exception
  */
 public String getPayloadAsString(String encoding) throws Exception {
   if (out instanceof ByteArrayOutputStream) {
     return StringMessageUtils.getString(((ByteArrayOutputStream) out).toByteArray(), encoding);
   } else {
     logger.warn("Attempting to get the String contents of a non-ByteArray output stream");
     return out.toString();
   }
 }