Getting Attachment from MIME email

Does anyone know how to get the attachment from an email in MIME format? I have a JAVA application that extracts attachments but it won’t work for emails that are in the MIME format.

Thanks