Package org.apache.camel.component.mail
Class MailConverters
java.lang.Object
org.apache.camel.component.mail.MailConverters
JavaMail specific converters.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> T
convertTo
(Class<T> type, org.apache.camel.Exchange exchange, Object value, org.apache.camel.spi.TypeConverterRegistry registry) Converts a JavaMail multipart into a body of any type a String can be converted into.static InputStream
toInputStream
(jakarta.mail.Message message) Converts the given JavaMail message to an InputStream.static InputStream
toInputStream
(jakarta.mail.Multipart multipart, org.apache.camel.Exchange exchange) Converts the given JavaMail multipart to a InputStream body, where the content-type of the multipart must be text based (ie start with text).static jakarta.mail.search.SearchTerm
toSearchTerm
(SimpleSearchTerm simple) Converters the simple search term builder to search term.static com.sun.mail.imap.SortTerm[]
toSortTerm
(String sortTerm) static String
toString
(jakarta.mail.Message message) Converts the given JavaMail message to a String body.static String
toString
(jakarta.mail.Multipart multipart) Converts the given JavaMail multipart to a String body, where the content-type of the multipart must be text based (ie start with text).
-
Method Details
-
toString
@Converter public static String toString(jakarta.mail.Message message) throws jakarta.mail.MessagingException, IOException Converts the given JavaMail message to a String body. Can return null.- Throws:
jakarta.mail.MessagingException
IOException
-
toString
@Converter public static String toString(jakarta.mail.Multipart multipart) throws jakarta.mail.MessagingException, IOException Converts the given JavaMail multipart to a String body, where the content-type of the multipart must be text based (ie start with text). Can return null.- Throws:
jakarta.mail.MessagingException
IOException
-
toInputStream
@Converter public static InputStream toInputStream(jakarta.mail.Message message) throws IOException, jakarta.mail.MessagingException Converts the given JavaMail message to an InputStream.- Throws:
IOException
jakarta.mail.MessagingException
-
toInputStream
@Converter public static InputStream toInputStream(jakarta.mail.Multipart multipart, org.apache.camel.Exchange exchange) throws IOException, jakarta.mail.MessagingException Converts the given JavaMail multipart to a InputStream body, where the content-type of the multipart must be text based (ie start with text). Can return null.- Throws:
IOException
jakarta.mail.MessagingException
-
convertTo
@Converter(fallback=true) public static <T> T convertTo(Class<T> type, org.apache.camel.Exchange exchange, Object value, org.apache.camel.spi.TypeConverterRegistry registry) throws jakarta.mail.MessagingException, IOException Converts a JavaMail multipart into a body of any type a String can be converted into. The content-type of the part must be text based.- Throws:
jakarta.mail.MessagingException
IOException
-
toSearchTerm
public static jakarta.mail.search.SearchTerm toSearchTerm(SimpleSearchTerm simple) throws ParseException Converters the simple search term builder to search term. This should not be a @Converter method- Throws:
ParseException
-
toSortTerm
-