Package net.rim.blackberry.api.mail

Examples of net.rim.blackberry.api.mail.MimeBodyPart


                        addTextFieldToTableAndScreen(new RichTextField(
                                plainText), BODY);
                    }
                }
            } else if (bodyPart instanceof MimeBodyPart) {
                final MimeBodyPart mimeBodyPart = (MimeBodyPart) bodyPart;

                // If the content is text then display it
                final String contentType = mimeBodyPart.getContentType();
                if (contentType
                        .startsWith(BodyPart.ContentType.TYPE_TEXT_HTML_STRING)) {
                    final Object obj = mimeBodyPart.getContent();
                    if (obj != null) {
                        final String htmlText = new String((byte[]) obj);
                        addTextFieldToTableAndScreen(
                                new RichTextField(htmlText), BODY);
                    }
                } else if (contentType
                        .equals(BodyPart.ContentType.TYPE_MULTIPART_ALTERNATIVE_STRING)) {
                    // If the body part is a multi-part and it has the the
                    // content type of TYPE_MULTIPART_ALTERNATIVE_STRING, then
                    // recursively display the multi-part.
                    final Object obj = mimeBodyPart.getContent();
                    if (obj instanceof Multipart) {
                        final Multipart childMultipart = (Multipart) obj;
                        final String childMultipartType =
                                childMultipart.getContentType();
                        if (childMultipartType
View Full Code Here

TOP

Related Classes of net.rim.blackberry.api.mail.MimeBodyPart

Copyright © 2018 www.massapicom. 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.