Example usage for org.apache.poi.hsmf.datatypes RecipientChunks getRecipientName

List of usage examples for org.apache.poi.hsmf.datatypes RecipientChunks getRecipientName

Introduction

In this page you can find the example usage for org.apache.poi.hsmf.datatypes RecipientChunks getRecipientName.

Prototype

public String getRecipientName() 

Source Link

Document

Tries to find their name, in whichever chunk holds it.

Usage

From source file:com.jaeksoft.searchlib.parser.MapiMsgParser.java

License:Open Source License

@Override
protected void parseContent(StreamLimiter streamLimiter, LanguageEnum lang)
        throws IOException, SearchLibException {
    MAPIMessage msg = new MAPIMessage(streamLimiter.getNewInputStream());
    msg.setReturnNullOnMissingChunk(true);
    ParserResultItem result = getNewParserResultItem();
    try {/*w  w w  .  j a  va2s.  co m*/
        result.addField(ParserFieldEnum.email_display_from, msg.getDisplayFrom());
        result.addField(ParserFieldEnum.email_display_to, msg.getDisplayTo());
        result.addField(ParserFieldEnum.email_display_cc, msg.getDisplayCC());
        result.addField(ParserFieldEnum.email_display_bcc, msg.getDisplayBCC());
        result.addField(ParserFieldEnum.subject, msg.getSubject());
        result.addField(ParserFieldEnum.htmlSource, msg.getHtmlBody());
        result.addField(ParserFieldEnum.content, msg.getTextBody());
        result.addField(ParserFieldEnum.creation_date, msg.getMessageDate());
        result.addField(ParserFieldEnum.email_conversation_topic, msg.getConversationTopic());
        RecipientChunks[] recipientChuncksList = msg.getRecipientDetailsChunks();
        if (recipientChuncksList != null) {
            for (RecipientChunks recipientChunks : recipientChuncksList) {
                result.addField(ParserFieldEnum.email_recipient_name, recipientChunks.getRecipientName());
                result.addField(ParserFieldEnum.email_recipient_address,
                        recipientChunks.getRecipientEmailAddress());
            }
        }
        if (StringUtils.isEmpty(msg.getHtmlBody()))
            result.langDetection(10000, ParserFieldEnum.content);
        else
            result.langDetection(10000, ParserFieldEnum.htmlSource);
    } catch (ChunkNotFoundException e) {
        Logging.warn(e);
    }
}

From source file:org.silverpeas.core.mail.extractor.MSGExtractor.java

License:Open Source License

private InternetAddress getInChunks(String name) throws UnsupportedEncodingException {
    RecipientChunks[] recipientChunks = message.getRecipientDetailsChunks();
    for (RecipientChunks recipient : recipientChunks) {
        if (name.equals(recipient.getRecipientName())) {
            return new InternetAddress(recipient.getRecipientEmailAddress(), recipient.getRecipientName());
        }// w w  w .j  ava 2s . c om
    }
    return null;
}

From source file:org.silverpeas.util.mail.MSGExtractor.java

License:Open Source License

private InternetAddress getInChunks(String name) throws UnsupportedEncodingException {
    RecipientChunks[] recipientChunks = message.getRecipientDetailsChunks();
    for (RecipientChunks recipient : recipientChunks) {
        if (name.equals(recipient.getRecipientName())) {
            InternetAddress address = new InternetAddress(recipient.getRecipientEmailAddress(),
                    recipient.getRecipientName());
            return address;
        }//from w  w  w  .java  2s .c o m
    }
    return null;
}