public static void enableContentRereadability()

in src/main/java/org/apache/servicemix/jbi/helper/MessageUtil.java [141:159]


    public static void enableContentRereadability(NormalizedMessage message) throws MessagingException {
        if (message.getContent() instanceof StreamSource
                || message.getContent() instanceof SAXSource) {
            try {
                String content = new SourceTransformer().contentToString(message);
                if (content != null) {
                    message.setContent(new StringSource(content));
                }
            } catch (TransformerException e) {
                throw new MessagingException("Unable to convert message content into StringSource", e);
            } catch (ParserConfigurationException e) {
                throw new MessagingException("Unable to convert message content into StringSource", e);
            } catch (IOException e) {
                throw new MessagingException("Unable to convert message content into StringSource", e);
            } catch (SAXException e) {
                throw new MessagingException("Unable to convert message content into StringSource", e);
            }
        }
    }