}
private void extractMultiPartMessage(final Multipart parts, final int partIndex) throws MessagingException {
try {
if (partIndex >= parts.getCount()) {
throw new StepFailedException("PartIndex too large.", this);
}
final BodyPart part = parts.getBodyPart(partIndex);
final String contentType = part.getContentType();
if (!StringUtils.isEmpty(getContentType()) && !contentType.equals(getContentType())) {
throw new MessagingException("Actual contentType of '" + contentType +