os.flush();
} else if (source != null) {
if (message.getAttachments() != null
&& !message.getAttachments().isEmpty()) {
message.put(AttachmentOutInterceptor.WRITE_ATTACHMENTS, Boolean.TRUE);
new AttachmentOutInterceptor().handleMessage(message);
}
OutputStream os = message.getContent(OutputStream.class);
doTransform(source, os);
os.flush();
} else if (dataSource != null) {
if (message.getAttachments() != null
&& !message.getAttachments().isEmpty()) {
message.put(AttachmentOutInterceptor.WRITE_ATTACHMENTS, Boolean.TRUE);
new AttachmentOutInterceptor().handleMessage(message);
}
message.put(Message.CONTENT_TYPE, dataSource.getContentType());
OutputStream os = message.getContent(OutputStream.class);
doTransform(dataSource, os);
os.flush();