private void addCustomMimeHeaders(Attachment att, AttachmentPart part) { if (att instanceof AttachmentEx) { Iterator<AttachmentEx.MimeHeader> allMimeHeaders = ((AttachmentEx) att).getMimeHeaders(); while (allMimeHeaders.hasNext()) { AttachmentEx.MimeHeader mh = allMimeHeaders.next(); String name = mh.getName(); if (!"Content-Type".equalsIgnoreCase(name) && !"Content-Id".equalsIgnoreCase(name)) { part.addMimeHeader(name, mh.getValue()); } } } }
private void addCustomMimeHeaders(Attachment att, AttachmentPart part) { if (att instanceof AttachmentEx) { Iterator<AttachmentEx.MimeHeader> allMimeHeaders = ((AttachmentEx) att).getMimeHeaders(); while (allMimeHeaders.hasNext()) { AttachmentEx.MimeHeader mh = allMimeHeaders.next(); String name = mh.getName(); if (!"Content-Type".equalsIgnoreCase(name) && !"Content-Id".equalsIgnoreCase(name)) { part.addMimeHeader(name, mh.getValue()); } } } }
private void addCustomMimeHeaders(Attachment att, AttachmentPart part) { if (att instanceof AttachmentEx) { Iterator<AttachmentEx.MimeHeader> allMimeHeaders = ((AttachmentEx) att).getMimeHeaders(); while (allMimeHeaders.hasNext()) { AttachmentEx.MimeHeader mh = allMimeHeaders.next(); String name = mh.getName(); if (!"Content-Type".equalsIgnoreCase(name) && !"Content-Id".equalsIgnoreCase(name)) { part.addMimeHeader(name, mh.getValue()); } } } }
static protected void addAttachmentsToSOAPMessage(SOAPMessage msg, Message message) { for(Attachment att : message.getAttachments()) { AttachmentPart part = msg.createAttachmentPart(); part.setDataHandler(att.asDataHandler()); // Be safe and avoid double angle-brackets. String cid = att.getContentId(); if (cid != null) { if (cid.startsWith("<") && cid.endsWith(">")) part.setContentId(cid); else part.setContentId('<' + cid + '>'); } // Add any MIME headers beside Content-ID, which is already // accounted for above, and Content-Type, which is provided // by the DataHandler above. if (att instanceof AttachmentEx) { AttachmentEx ax = (AttachmentEx) att; Iterator<AttachmentEx.MimeHeader> imh = ax.getMimeHeaders(); while (imh.hasNext()) { AttachmentEx.MimeHeader ame = imh.next(); if ((!"Content-ID".equalsIgnoreCase(ame.getName())) && (!"Content-Type".equalsIgnoreCase(ame.getName()))) part.addMimeHeader(ame.getName(), ame.getValue()); } } msg.addAttachmentPart(part); } }
static protected void addAttachmentsToSOAPMessage(SOAPMessage msg, Message message) { for(Attachment att : message.getAttachments()) { AttachmentPart part = msg.createAttachmentPart(); part.setDataHandler(att.asDataHandler()); // Be safe and avoid double angle-brackets. String cid = att.getContentId(); if (cid != null) { if (cid.startsWith("<") && cid.endsWith(">")) part.setContentId(cid); else part.setContentId('<' + cid + '>'); } // Add any MIME headers beside Content-ID, which is already // accounted for above, and Content-Type, which is provided // by the DataHandler above. if (att instanceof AttachmentEx) { AttachmentEx ax = (AttachmentEx) att; Iterator<AttachmentEx.MimeHeader> imh = ax.getMimeHeaders(); while (imh.hasNext()) { AttachmentEx.MimeHeader ame = imh.next(); if ((!"Content-ID".equalsIgnoreCase(ame.getName())) && (!"Content-Type".equalsIgnoreCase(ame.getName()))) part.addMimeHeader(ame.getName(), ame.getValue()); } } msg.addAttachmentPart(part); } }
static protected void addAttachmentsToSOAPMessage(SOAPMessage msg, Message message) { for(Attachment att : message.getAttachments()) { AttachmentPart part = msg.createAttachmentPart(); part.setDataHandler(att.asDataHandler()); // Be safe and avoid double angle-brackets. String cid = att.getContentId(); if (cid != null) { if (cid.startsWith("<") && cid.endsWith(">")) part.setContentId(cid); else part.setContentId('<' + cid + '>'); } // Add any MIME headers beside Content-ID, which is already // accounted for above, and Content-Type, which is provided // by the DataHandler above. if (att instanceof AttachmentEx) { AttachmentEx ax = (AttachmentEx) att; Iterator<AttachmentEx.MimeHeader> imh = ax.getMimeHeaders(); while (imh.hasNext()) { AttachmentEx.MimeHeader ame = imh.next(); if ((!"Content-ID".equals(ame.getName())) && (!"Content-Type".equals(ame.getName()))) part.addMimeHeader(ame.getName(), ame.getValue()); } } msg.addAttachmentPart(part); } }
String h = i.next(); String val = a.getHeader(h); ap.addMimeHeader(h, val);
String h = i.next(); String val = a.getHeader(h); ap.addMimeHeader(h, val);