MultiPartDataSource(Message message, DataSource root) { atts = message.getAttachments().iterator(); String s = (String)message.get(Message.CONTENT_TYPE); boundary = findBoundary(s); start = findStart(s); if (!s.contains(boundary)) { s += "; boundary=\"" + boundary + "\""; } contentType = s; rootPart = root; try { writer = new OutputStreamWriter(bout, "ASCII"); writer.append("Content-Type: ").append(contentType).append("\r\n\r\n"); writer.flush(); current = bout.createInputStream(); } catch (Exception e) { //nothing } }
MultiPartDataSource(Message message, DataSource root) { atts = message.getAttachments().iterator(); String s = (String)message.get(Message.CONTENT_TYPE); boundary = findBoundary(s); start = findStart(s); if (!s.contains(boundary)) { s += "; boundary=\"" + boundary + "\""; } contentType = s; rootPart = root; try { writer = new OutputStreamWriter(bout, "ASCII"); writer.append("Content-Type: ").append(contentType).append("\r\n\r\n"); writer.flush(); current = bout.createInputStream(); } catch (Exception e) { //nothing } }
private void doDataSource(final Message message) { MessageContentsList list = (MessageContentsList)message.getContent(List.class); //reconstitute all the parts into a Mime data source if (message.getAttachments() != null && !message.getAttachments().isEmpty() && list != null && !list.isEmpty() && list.get(0) instanceof DataSource) { list.set(0, new MultiPartDataSource(message, (DataSource)list.get(0))); } }
private void doDataSource(final Message message) { MessageContentsList list = (MessageContentsList)message.getContent(List.class); //reconstitute all the parts into a Mime data source if (message.getAttachments() != null && !message.getAttachments().isEmpty() && list != null && !list.isEmpty() && list.get(0) instanceof DataSource) { list.set(0, new MultiPartDataSource(message, (DataSource)list.get(0))); } }