Package org.apache.camel.component.mail
Class MailBinding
- java.lang.Object
-
- org.apache.camel.component.mail.MailBinding
-
public class MailBinding extends Object
A Strategy used to convert between a CamelExchange
andMessage
to and from a MailMimeMessage
-
-
Constructor Summary
Constructors Constructor Description MailBinding()
MailBinding(org.apache.camel.spi.HeaderFilterStrategy headerFilterStrategy, ContentTypeResolver contentTypeResolver, boolean decodeFilename)
Deprecated.MailBinding(org.apache.camel.spi.HeaderFilterStrategy headerFilterStrategy, ContentTypeResolver contentTypeResolver, boolean decodeFilename, boolean mapMailMessage)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addAttachmentsToMultipart(javax.mail.internet.MimeMultipart multipart, String partDisposition, AttachmentsContentTransferEncodingResolver encodingResolver, org.apache.camel.Exchange exchange)
protected void
addBodyToMultipart(MailConfiguration configuration, javax.mail.internet.MimeMultipart activeMultipart, org.apache.camel.Exchange exchange)
protected void
appendAttachmentsFromCamel(javax.mail.internet.MimeMessage mimeMessage, MailConfiguration configuration, org.apache.camel.Exchange exchange)
Appends the Mail attachments from the CamelMailMessage
protected void
appendHeadersFromCamelMessage(javax.mail.internet.MimeMessage mimeMessage, MailConfiguration configuration, org.apache.camel.Exchange exchange)
Appends the Mail headers from the CamelMailMessage
protected void
createMultipartAlternativeMessage(javax.mail.internet.MimeMessage mimeMessage, MailConfiguration configuration, org.apache.camel.Exchange exchange)
protected static String
determineCharSet(MailConfiguration configuration, org.apache.camel.Exchange exchange)
protected String
determineContentType(MailConfiguration configuration, org.apache.camel.Exchange exchange)
void
extractAttachmentsFromMail(javax.mail.Message message, Map<String,org.apache.camel.attachment.Attachment> map)
Parses the attachments of the given mail message and adds them to the mapprotected void
extractAttachmentsFromMultipart(javax.mail.Multipart mp, Map<String,org.apache.camel.attachment.Attachment> map)
Object
extractBodyFromMail(org.apache.camel.Exchange exchange, MailMessage mailMessage)
Extracts the body from the Mail messageprotected Map<String,Object>
extractHeadersFromMail(javax.mail.Message mailMessage, org.apache.camel.Exchange exchange)
protected static String
getAlternativeBody(MailConfiguration configuration, org.apache.camel.Exchange exchange)
protected static boolean
hasAlternativeBody(MailConfiguration configuration, org.apache.camel.Exchange exchange)
protected String
populateContentOnBodyPart(javax.mail.BodyPart part, MailConfiguration configuration, org.apache.camel.Exchange exchange)
protected String
populateContentOnMimeMessage(javax.mail.internet.MimeMessage part, MailConfiguration configuration, org.apache.camel.Exchange exchange)
void
populateMailMessage(MailEndpoint endpoint, javax.mail.internet.MimeMessage mimeMessage, org.apache.camel.Exchange exchange)
protected void
resolveContentTransferEncoding(AttachmentsContentTransferEncodingResolver resolver, int i, javax.mail.BodyPart messageBodyPart)
protected void
setRecipientFromEndpointConfiguration(javax.mail.internet.MimeMessage mimeMessage, MailEndpoint endpoint, org.apache.camel.Exchange exchange)
Appends the Mail headers from the endpoint configuration.protected boolean
shouldAddAttachment(org.apache.camel.Exchange exchange, String attachmentFilename, DataHandler handler)
Strategy to allow filtering of attachments which are added on the Mail message
-
-
-
Constructor Detail
-
MailBinding
public MailBinding()
-
MailBinding
@Deprecated public MailBinding(org.apache.camel.spi.HeaderFilterStrategy headerFilterStrategy, ContentTypeResolver contentTypeResolver, boolean decodeFilename)
Deprecated.
-
MailBinding
public MailBinding(org.apache.camel.spi.HeaderFilterStrategy headerFilterStrategy, ContentTypeResolver contentTypeResolver, boolean decodeFilename, boolean mapMailMessage)
-
-
Method Detail
-
populateMailMessage
public void populateMailMessage(MailEndpoint endpoint, javax.mail.internet.MimeMessage mimeMessage, org.apache.camel.Exchange exchange) throws javax.mail.MessagingException, IOException
- Throws:
javax.mail.MessagingException
IOException
-
determineContentType
protected String determineContentType(MailConfiguration configuration, org.apache.camel.Exchange exchange)
-
determineCharSet
protected static String determineCharSet(MailConfiguration configuration, org.apache.camel.Exchange exchange)
-
populateContentOnMimeMessage
protected String populateContentOnMimeMessage(javax.mail.internet.MimeMessage part, MailConfiguration configuration, org.apache.camel.Exchange exchange) throws javax.mail.MessagingException, IOException
- Throws:
javax.mail.MessagingException
IOException
-
populateContentOnBodyPart
protected String populateContentOnBodyPart(javax.mail.BodyPart part, MailConfiguration configuration, org.apache.camel.Exchange exchange) throws javax.mail.MessagingException, IOException
- Throws:
javax.mail.MessagingException
IOException
-
extractBodyFromMail
public Object extractBodyFromMail(org.apache.camel.Exchange exchange, MailMessage mailMessage)
Extracts the body from the Mail message
-
extractAttachmentsFromMail
public void extractAttachmentsFromMail(javax.mail.Message message, Map<String,org.apache.camel.attachment.Attachment> map) throws javax.mail.MessagingException, IOException
Parses the attachments of the given mail message and adds them to the map- Parameters:
message
- the mail message with attachmentsmap
- the map to add found attachments (attachmentFilename is the key)- Throws:
javax.mail.MessagingException
IOException
-
extractAttachmentsFromMultipart
protected void extractAttachmentsFromMultipart(javax.mail.Multipart mp, Map<String,org.apache.camel.attachment.Attachment> map) throws javax.mail.MessagingException, IOException
- Throws:
javax.mail.MessagingException
IOException
-
appendHeadersFromCamelMessage
protected void appendHeadersFromCamelMessage(javax.mail.internet.MimeMessage mimeMessage, MailConfiguration configuration, org.apache.camel.Exchange exchange) throws javax.mail.MessagingException, IOException
Appends the Mail headers from the CamelMailMessage
- Throws:
javax.mail.MessagingException
IOException
-
setRecipientFromEndpointConfiguration
protected void setRecipientFromEndpointConfiguration(javax.mail.internet.MimeMessage mimeMessage, MailEndpoint endpoint, org.apache.camel.Exchange exchange) throws javax.mail.MessagingException, IOException
Appends the Mail headers from the endpoint configuration.- Throws:
javax.mail.MessagingException
IOException
-
appendAttachmentsFromCamel
protected void appendAttachmentsFromCamel(javax.mail.internet.MimeMessage mimeMessage, MailConfiguration configuration, org.apache.camel.Exchange exchange) throws javax.mail.MessagingException, IOException
Appends the Mail attachments from the CamelMailMessage
- Throws:
javax.mail.MessagingException
IOException
-
addAttachmentsToMultipart
protected void addAttachmentsToMultipart(javax.mail.internet.MimeMultipart multipart, String partDisposition, AttachmentsContentTransferEncodingResolver encodingResolver, org.apache.camel.Exchange exchange) throws javax.mail.MessagingException
- Throws:
javax.mail.MessagingException
-
resolveContentTransferEncoding
protected void resolveContentTransferEncoding(AttachmentsContentTransferEncodingResolver resolver, int i, javax.mail.BodyPart messageBodyPart) throws javax.mail.MessagingException
- Throws:
javax.mail.MessagingException
-
createMultipartAlternativeMessage
protected void createMultipartAlternativeMessage(javax.mail.internet.MimeMessage mimeMessage, MailConfiguration configuration, org.apache.camel.Exchange exchange) throws javax.mail.MessagingException, IOException
- Throws:
javax.mail.MessagingException
IOException
-
addBodyToMultipart
protected void addBodyToMultipart(MailConfiguration configuration, javax.mail.internet.MimeMultipart activeMultipart, org.apache.camel.Exchange exchange) throws javax.mail.MessagingException, IOException
- Throws:
javax.mail.MessagingException
IOException
-
shouldAddAttachment
protected boolean shouldAddAttachment(org.apache.camel.Exchange exchange, String attachmentFilename, DataHandler handler)
Strategy to allow filtering of attachments which are added on the Mail message
-
extractHeadersFromMail
protected Map<String,Object> extractHeadersFromMail(javax.mail.Message mailMessage, org.apache.camel.Exchange exchange) throws javax.mail.MessagingException, IOException
- Throws:
javax.mail.MessagingException
IOException
-
hasAlternativeBody
protected static boolean hasAlternativeBody(MailConfiguration configuration, org.apache.camel.Exchange exchange)
-
getAlternativeBody
protected static String getAlternativeBody(MailConfiguration configuration, org.apache.camel.Exchange exchange)
-
-