private void copyContent()

in src/main/java/org/apache/servicemix/jbi/transformer/CopyTransformer.java [144:164]


    private void copyContent(NormalizedMessage from, NormalizedMessage to) throws MessagingException {
        Source content = from.getContent();
        if ((content instanceof StreamSource || content instanceof SAXSource)
                && !(content instanceof StringSource)
                && !(content instanceof BytesSource)
                && !(content instanceof ResourceSource)) {
            // lets avoid stream open exceptions by using a temporary format
            try {
                content = sourceTransformer.toDOMSource(from);
            } catch (TransformerException e) {
                throw new MessagingException(e);
            } catch (ParserConfigurationException e) {
                throw new MessagingException(e);
            } catch (IOException e) {
                throw new MessagingException(e);
            } catch (SAXException e) {
                throw new MessagingException(e);
            }
        }
        to.setContent(content);
    }