Package lotus.domino

Examples of lotus.domino.MIMEEntity


  public boolean isEmpty(DominoDocument doc, String fieldName) throws Exception {
    if(doc!=null) {
      Item item = doc.getDocument().getFirstItem(fieldName);
      if(item!=null) {
        String content;
        MIMEEntity e = item.getMIMEEntity();
        if(e!=null) {
          content = e.getContentAsText();
        } else {
          content = item.getText();
        }
        if(!StringUtil.isSpace(content)) {
          // Should handle empty json objects/arrays as well
View Full Code Here


      boolean convertMime = session.isConvertMime();
      session.setConvertMIME(false);
      try {
 
        MIMEEntity topRelated = doc.createMIMEEntity("Body"); //$NON-NLS-1$
 
        // Set up the multipart header
        MIMEHeader header = topRelated.createHeader("Content-Type"); //$NON-NLS-1$
 
        // EE needs to use multipart/alternative or the email clients will
        // turn the content into an attachment.
        header.setHeaderVal("multipart/related");
 
        MIMEEntity topAlternative = topRelated.createChildEntity();
 
        // Set up the multipart header
        header = topAlternative.createHeader("Content-Type");
 
        // EE needs to use multipart/alternative or the email clients will
        // turn the content into an attachment.
        header.setHeaderVal("multipart/alternative");
 
        try {
          for(MimePart part : getMimeParts()) {
            MIMEEntity mime = topAlternative.createChildEntity();
            try {
              lotus.domino.Stream stream = session.createStream();
              try {
                String mimeType = part.getMimeType();
                String content = part.getContent();
                stream.writeText(content);
                mime.setContentFromText(stream, mimeType, 0);
                if(StringUtil.equals(mimeType, "text/plain")) {
                  mime.encodeContent(MIMEEntity.ENC_QUOTED_PRINTABLE);
                } else {
                        mime.encodeContent(MIMEEntity.ENC_BASE64);
                }
              } finally {
                stream.close();
                stream.recycle();
              }
            } finally {
              mime.recycle();
            }
                }
 
         
 
View Full Code Here

TOP

Related Classes of lotus.domino.MIMEEntity

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.