public void write(OutputStream os) throws IOException{ attachment.writeTo(os); }
@SuppressWarnings("resource") private void writeNonMtomAttachments(AttachmentSet attachments, OutputStream out, String boundary) throws IOException { for (Attachment att : attachments) { DataHandler dh = att.asDataHandler(); if (dh instanceof StreamingDataHandler) { StreamingDataHandler sdh = (StreamingDataHandler) dh; // If DataHandler has href Content-ID, it is MTOM, so skip. if (sdh.getHrefCid() != null) continue; } // build attachment frame writeln("--" + boundary, out); writeMimeHeaders(att.getContentType(), att.getContentId(), out); att.writeTo(out); writeln(out); // write \r\n } }
@SuppressWarnings("resource") private void writeNonMtomAttachments(AttachmentSet attachments, OutputStream out, String boundary) throws IOException { for (Attachment att : attachments) { DataHandler dh = att.asDataHandler(); if (dh instanceof StreamingDataHandler) { StreamingDataHandler sdh = (StreamingDataHandler) dh; // If DataHandler has href Content-ID, it is MTOM, so skip. if (sdh.getHrefCid() != null) continue; } // build attachment frame writeln("--" + boundary, out); writeMimeHeaders(att.getContentType(), att.getContentId(), out); att.writeTo(out); writeln(out); // write \r\n } }
@SuppressWarnings("resource") private void writeNonMtomAttachments(AttachmentSet attachments, OutputStream out, String boundary) throws IOException { for (Attachment att : attachments) { DataHandler dh = att.asDataHandler(); if (dh instanceof StreamingDataHandler) { StreamingDataHandler sdh = (StreamingDataHandler) dh; // If DataHandler has href Content-ID, it is MTOM, so skip. if (sdh.getHrefCid() != null) continue; } // build attachment frame writeln("--" + boundary, out); writeMimeHeaders(att.getContentType(), att.getContentId(), out); att.writeTo(out); writeln(out); // write \r\n } }
writeln("Content-Transfer-Encoding: binary", out); att.writeTo(out);
writeln("Content-Transfer-Encoding: binary", out); att.writeTo(out);
writeln("Content-Transfer-Encoding: binary", out); att.writeTo(out);