use of com.fsck.k9.mail.DefaultBodyFactory in project k-9 by k9mail.
the class MimeMessage method parse.
private void parse(InputStream in, boolean recurse) throws IOException, MessagingException {
mHeader.clear();
mFrom = null;
mTo = null;
mCc = null;
mBcc = null;
mReplyTo = null;
xOriginalTo = null;
deliveredTo = null;
xEnvelopeTo = null;
mMessageId = null;
mReferences = null;
mInReplyTo = null;
mSentDate = null;
mBody = null;
MimeConfig parserConfig = new MimeConfig.Builder().setMaxHeaderLen(-1).setMaxLineLen(-1).setMaxHeaderCount(-1).build();
MimeStreamParser parser = new MimeStreamParser(parserConfig);
parser.setContentHandler(new MimeMessageBuilder(new DefaultBodyFactory()));
if (recurse) {
parser.setRecurse();
}
try {
parser.parse(new EOLConvertingInputStream(in));
} catch (MimeException me) {
throw new MessagingException(me.getMessage(), me);
}
}
Aggregations