}
if(data != null) {
HtmlParser htmlParser = new HtmlParser();
htmlParser.parse(
new ByteArrayInputStream(data),
new EmbeddedContentHandler(new BodyContentHandler(xhtml)),
new Metadata(), new ParseContext()
);
doneBody = true;
}
}
if(rtfChunk != null && !doneBody) {
ByteChunk chunk = (ByteChunk)rtfChunk;
MAPIRtfAttribute rtf = new MAPIRtfAttribute(
MAPIProperty.RTF_COMPRESSED, Types.BINARY, chunk.getValue()
);
RTFParser rtfParser = new RTFParser();
rtfParser.parse(
new ByteArrayInputStream(rtf.getData()),
new EmbeddedContentHandler(new BodyContentHandler(xhtml)),
new Metadata(), new ParseContext());
doneBody = true;
}
if(textChunk != null && !doneBody) {
xhtml.element("p", ((StringChunk)textChunk).getValue());