// create a representation from part.getInputStream()
}
} else {
// Check if plain text
final MimeBodyPart mimeBodyPart = (MimeBodyPart) part;
final ContentType contentType = new ContentType(
mimeBodyPart.getContentType());
if (MediaType.TEXT_PLAIN.equals(contentType.getMediaType(),
true)) {
content = new InputRepresentation(mimeBodyPart
.getInputStream(), MediaType.TEXT_PLAIN);
break;
}
// TODO Special non-attachment cases here of
// image/gif, text/html, ...
}
}
} else {
// Add the email body
if (message.getContentType() != null) {
final ContentType contentType = new ContentType(message
.getContentType());
if (MediaType.TEXT_PLAIN.equals(contentType.getMediaType(),
true)) {
content = new InputRepresentation(message.getInputStream(),
MediaType.TEXT_PLAIN);
}
}