Examples of DeferredFileOutputStream


Examples of org.subethamail.smtp.io.DeferredFileOutputStream

public class MimeMessageConverter {
    private Logger logger = LoggerFactory.getLogger(MimeMessageConverter.class);

    public MailData createMailDataInSmtpSession(MimeMessage mimeMessage)
            throws RejectExceptionExt {
        DeferredFileOutputStream deferredFileOutputStream =
                new DeferredFileOutputStream(32768);
        try {
            mimeMessage.writeTo(deferredFileOutputStream);
        } catch (IOException e) {
            logger.error("Cannot write MimeMessage", e);
            try {
                deferredFileOutputStream.close();
            } catch (IOException e1) {
                logger.warn("Cannot close deferredFileOutputStream", e1);
            }
            throw new RejectExceptionExt(
                    EnhancedStatus.TRANSIENT_LOCAL_ERROR_IN_PROCESSING);
        } catch (MessagingException e) {
            logger.error("Cannot write MimeMessage", e);
            try {
                deferredFileOutputStream.close();
            } catch (IOException e1) {
                logger.warn("Cannot close deferredFileOutputStream", e1);
            }
            throw new RejectExceptionExt(
                    EnhancedStatus.TRANSIENT_LOCAL_ERROR_IN_PROCESSING);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.