/** * Output the body part as an RFC 822 format stream. * * @exception IOException if an error occurs writing to the * stream or if an error is generated * by the javax.activation layer. * @exception MessagingException for other failures * @see javax.activation.DataHandler#writeTo */ public void writeTo(OutputStream os) throws IOException, MessagingException { writeTo(this, os, null); }
/** * Output the body part as an RFC 822 format stream. * * @exception IOException if an error occurs writing to the * stream or if an error is generated * by the javax.activation layer. * @exception MessagingException for other failures * @see javax.activation.DataHandler#writeTo */ @Override public void writeTo(OutputStream os) throws IOException, MessagingException { writeTo(this, os, null); }
MimeBodyPart.writeTo(this, os, ignoreList); return;
MimeBodyPart.writeTo(this, os, ignoreList); return;
encrypted = generator.open(baos, encryptor); _msg.writeTo(encrypted); encrypted.close(); byte[] bytes = baos.toByteArray();
for (int i = 0; i < parts.size(); i++) { ((MimeBodyPart)parts.elementAt(i)).writeTo(os);
for (int i = 0; i < parts.size(); i++) { ((MimeBodyPart)parts.elementAt(i)).writeTo(os);
/** * Output the body part as an RFC 822 format stream. * * @exception MessagingException * @exception IOException if an error occurs writing to the * stream or if an error is generated * by the javax.activation layer. * @see javax.activation.DataHandler#writeTo */ public void writeTo(OutputStream os) throws IOException, MessagingException { writeTo(this, os, null); }
/** * Output the body part as an RFC 822 format stream. * * @exception IOException if an error occurs writing to the * stream or if an error is generated * by the javax.activation layer. * @exception MessagingException for other failures * @see javax.activation.DataHandler#writeTo */ @Override public void writeTo(OutputStream os) throws IOException, MessagingException { writeTo(this, os, null); }
/** * Output the body part as an RFC 822 format stream. * * @exception IOException if an error occurs writing to the * stream or if an error is generated * by the javax.activation layer. * @exception MessagingException for other failures * @see javax.activation.DataHandler#writeTo */ @Override public void writeTo(OutputStream os) throws IOException, MessagingException { writeTo(this, os, null); }
/** * Output the body part as an RFC 822 format stream. * * @exception IOException if an error occurs writing to the * stream or if an error is generated * by the javax.activation layer. * @exception MessagingException for other failures * @see javax.activation.DataHandler#writeTo */ @Override public void writeTo(OutputStream os) throws IOException, MessagingException { writeTo(this, os, null); }
/** * Output the body part as an RFC 822 format stream. * * @exception MessagingException * @exception IOException if an error occurs writing to the * stream or if an error is generated * by the javax.activation layer. * @see javax.activation.DataHandler#writeTo */ public void writeTo(OutputStream os) throws IOException, MessagingException { writeTo(this, os, null); }
/** * Output the body part as an RFC 822 format stream. * * @exception IOException if an error occurs writing to the * stream or if an error is generated * by the javax.activation layer. * @exception MessagingException for other failures * @see javax.activation.DataHandler#writeTo */ @Override public void writeTo(OutputStream os) throws IOException, MessagingException { writeTo(this, os, null); }
/** * Output the body part as an RFC 822 format stream. * * @exception IOException if an error occurs writing to the * stream or if an error is generated * by the javax.activation layer. * @exception MessagingException for other failures * @see javax.activation.DataHandler#writeTo */ @Override public void writeTo(OutputStream os) throws IOException, MessagingException { writeTo(this, os, null); }
/** * Output the body part as an RFC 822 format stream. * * @exception IOException if an error occurs writing to the * stream or if an error is generated * by the javax.activation layer. * @exception MessagingException for other failures * @see javax.activation.DataHandler#writeTo */ @Override public void writeTo(OutputStream os) throws IOException, MessagingException { writeTo(this, os, null); }
MimeBodyPart body = new MimeBodyPart(); body.setContent(multiPart); multipartSigned.addBodyPart(body); msg.setContent(multipartSigned); msg.saveChanges(); try (OutputStream str = Files.newOutputStream(Paths .get(UNSIGNED_MIME))) { body.writeTo(str); str.close(); };
public static String toString(MimeBodyPart mbp, boolean addDelimiterText) throws IOException, MessagingException { ByteArrayOutputStream os = new ByteArrayOutputStream(); if (addDelimiterText) os.write("========BEGIN MIMEBODYPART=========\n".getBytes()); mbp.writeTo(os); if (addDelimiterText) os.write("\n========END MIMEBODYPART=========".getBytes()); return os.toString(); }
public static void write(OutputStream os, MimeBodyPart mbp) throws MessagingException, IOException { os.write((System.getProperty("line.separator") + "========BEGIN MIMEBODYPART=========" + System.getProperty("line.separator")).getBytes()); mbp.writeTo(os); os.write((System.getProperty("line.separator") + "========END MIMEBODYPART=========" + System.getProperty("line.separator")).getBytes()); }
/** * Calculates sha1 mic based on the MIME body part. */ public static Digest calculateMic(MimeBodyPart bodyPart, SMimeDigestMethod digestMethod) { try { MessageDigest md = BCHelper.getMessageDigest(digestMethod.getIdentifier()); bodyPart.writeTo(new DigestOutputStream(ByteStreams.nullOutputStream(), md)); return Digest.of(digestMethod.getDigestMethod(), md.digest()); } catch (NoSuchAlgorithmException e) { throw new IllegalStateException(digestMethod.getIdentifier() + " not found", e); } catch (IOException e) { throw new IllegalStateException("Unable to read data from digest input. " + e.getMessage(), e); } catch (MessagingException e) { throw new IllegalStateException("Unable to handle mime body part. " + e.getMessage(), e); } }
/** * Calculates sha1 mic based on the MIME body part. */ public static Digest calculateMic(MimeBodyPart bodyPart, SMimeDigestMethod digestMethod) { try { MessageDigest md = BCHelper.getMessageDigest(digestMethod.getIdentifier()); bodyPart.writeTo(new DigestOutputStream(ByteStreams.nullOutputStream(), md)); return Digest.of(digestMethod.getDigestMethod(), md.digest()); } catch (NoSuchAlgorithmException e) { throw new IllegalStateException(digestMethod.getIdentifier() + " not found", e); } catch (IOException e) { throw new IllegalStateException("Unable to read data from digest input. " + e.getMessage(), e); } catch (MessagingException e) { throw new IllegalStateException("Unable to handle mime body part. " + e.getMessage(), e); } }