Package org.apache.james.mime4j.dom

Examples of org.apache.james.mime4j.dom.BinaryBody.writeTo()


    }

    private String getBinPart(Entity part) throws IOException {
        BinaryBody bb = (BinaryBody) part.getBody();
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        bb.writeTo(baos);
        return new String(baos.toByteArray());
    }

    /*
     * taken from http://svn.apache.org/repos/asf/james/mime4j/trunk/examples/src/main/java/org/apache/james/mime4j/samples/transform/TransformMessage.java
View Full Code Here


       
        try {
            Body b = e.getBody();
            if (b instanceof BinaryBody) {
                bb = (BinaryBody) b;
                bb.writeTo(fos);
            } else {
                // This could potentially be other types. Only seen this once.
            }
        } catch (IOException ex) {
            logger.log(Level.INFO, "Failed to write mbox email attachment to disk.", ex); //NON-NLS
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.