in core/servicemix-core/src/main/java/org/apache/servicemix/components/util/CopyTransformer.java [110:145]
public boolean transform(MessageExchange exchange, NormalizedMessage from,
NormalizedMessage to) throws MessagingException {
if (copyProperties) {
copyProperties(from, to);
}
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);
if (copyAttachments) {
copyAttachments(from, to);
}
if (copySecuritySubject) {
copySecuritySubject(from, to);
}
return true;
}