contentId = IDGenerator.generateID();
}
DataHandler handler = attachment.getDataHandler();
// make sure that AttachmentPart content-type overrides DataHandler content-type
if (!SAAJUtil.compareContentTypes(attachment.getContentType(), handler.getContentType())) {
ConfigurableDataHandler configuredHandler = new ConfigurableDataHandler(handler.getDataSource());
configuredHandler.setContentType(attachment.getContentType());
handler = configuredHandler;
}
attachments.addDataHandler(contentId, handler);
}
options.setProperty(Constants.Configuration.ENABLE_SWA, Constants.VALUE_TRUE);