} else {
embeddedExtractor = ex;
}
// Ask POI to process the file for us
HMEFMessage msg = new HMEFMessage(stream);
// Set the message subject if known
String subject = msg.getSubject();
if(subject != null && subject.length() > 0) {
// TODO: Move to title in Tika 2.0
metadata.set(TikaCoreProperties.TRANSITION_SUBJECT_TO_DC_TITLE, subject);
}
// Recurse into the message body RTF
MAPIAttribute attr = msg.getMessageMAPIAttribute(MAPIProperty.RTF_COMPRESSED);
if(attr != null && attr instanceof MAPIRtfAttribute) {
MAPIRtfAttribute rtf = (MAPIRtfAttribute)attr;
handleEmbedded(
"message.rtf", "application/rtf",
rtf.getData(),
embeddedExtractor, handler
);
}
// Recurse into each attachment in turn
for(Attachment attachment : msg.getAttachments()) {
String name = attachment.getLongFilename();
if(name == null || name.length() == 0) {
name = attachment.getFilename();
}
if(name == null || name.length() == 0) {