Example usage for javax.mail.internet MimeMessage getLineCount

List of usage examples for javax.mail.internet MimeMessage getLineCount

Introduction

In this page you can find the example usage for javax.mail.internet MimeMessage getLineCount.

Prototype

@Override
public int getLineCount() throws MessagingException 

Source Link

Document

Return the number of lines for the content of this message.

Usage

From source file:org.zilverline.core.IMAPCollection.java

/**
 * Index a MIME message, which seems to be all of them.
 *///  ww  w  . ja  v a2  s.  com
private void indexMimeMessage(final Document doc, final MimeMessage mm) throws MessagingException, IOException {
    // o.println( "\n\n[index mm]: " + mm.getSubject());

    long size = mm.getSize();
    int lines = mm.getLineCount();
    doc.add(Field.Keyword("hash", mm.getMessageID()));

    if (size > 0) {
        doc.add(Field.UnIndexed(F_SIZE, "" + size));
    } else {
        doc.add(Field.UnIndexed(F_SIZE, "" + 0));
    }
    indexPart(doc, mm);
}