Search in sources :

Example 46 with MimePart

use of javax.mail.internet.MimePart in project zm-mailbox by Zimbra.

the class AttachmentDataSource method getContentType.

public String getContentType() {
    String contentType = null;
    MimePart mp = null;
    try {
        mp = getMimePart();
        if (mp != null) {
            contentType = mp.getContentType();
        }
    } catch (Exception e) {
        ZimbraLog.mailbox.error("Unable to determine content type for contact %d.", mContact.getId(), e);
    }
    return contentType;
}
Also used : MimePart(javax.mail.internet.MimePart) MessagingException(javax.mail.MessagingException) IOException(java.io.IOException) ServiceException(com.zimbra.common.service.ServiceException)

Aggregations

MimePart (javax.mail.internet.MimePart)46 MessagingException (javax.mail.MessagingException)22 MimeMessage (javax.mail.internet.MimeMessage)22 IOException (java.io.IOException)15 NoSuchMimePartException (com.axway.ats.action.objects.model.NoSuchMimePartException)12 PackageException (com.axway.ats.action.objects.model.PackageException)11 NoSuchMimePackageException (com.axway.ats.action.objects.model.NoSuchMimePackageException)10 PublicAtsApi (com.axway.ats.common.PublicAtsApi)10 InputStream (java.io.InputStream)10 ServiceException (com.zimbra.common.service.ServiceException)8 Test (org.junit.Test)8 MimePackage (com.axway.ats.action.objects.MimePackage)6 ByteArrayInputStream (java.io.ByteArrayInputStream)6 ContentType (javax.mail.internet.ContentType)6 BaseTest (com.axway.ats.action.BaseTest)5 Message (com.zimbra.cs.mailbox.Message)5 MPartInfo (com.zimbra.cs.mime.MPartInfo)5 MimeMultipart (javax.mail.internet.MimeMultipart)5 ContentType (com.zimbra.common.mime.ContentType)4 ArrayList (java.util.ArrayList)4