* @throws IOException
* Signals that an I/O exception has occurred.
*/
private List<DataSource> parsePartsCore(InputStream entityInputStream,
String contentType) throws MessagingException, IOException {
DataSource dataSource = new InputStreamDataSource(entityInputStream,
contentType);
MimeMultipart batch = new MimeMultipart(dataSource);
MimeBodyPart batchBody = (MimeBodyPart) batch.getBodyPart(0);
MimeMultipart changeSets = new MimeMultipart(new MimePartDataSource(
batchBody));
List<DataSource> result = new ArrayList<DataSource>();
for (int i = 0; i < changeSets.getCount(); i++) {
BodyPart part = changeSets.getBodyPart(i);
result.add(new InputStreamDataSource(part.getInputStream(), part
.getContentType()));
}
return result;
}