Class JavaReadMailer


  • public class JavaReadMailer
    extends JavaMailer2
    JavaMail implementation for reading electronic mail.
    Version:
    $Id: $
    Author:
    David Hustace
    • Method Detail

      • finalize

        protected void finalize()
                         throws java.lang.Throwable
        Finalizer to be sure and close with the appropriate mode any open folders
        Overrides:
        finalize in class java.lang.Object
        Throws:
        java.lang.Throwable
      • retrieveMessages

        public java.util.List<javax.mail.Message> retrieveMessages​(javax.mail.search.SearchTerm term)
                                                            throws JavaMailerException

        retrieveMessages

        Parameters:
        term - a SearchTerm object.
        Returns:
        a List object.
        Throws:
        JavaMailerException - if any.
      • getMessages

        public java.util.List<javax.mail.Message> getMessages()

        getMessages

        Returns:
        a List object.
      • getText

        public static java.util.List<java.lang.String> getText​(javax.mail.Message msg)
                                                        throws javax.mail.MessagingException,
                                                               java.io.IOException
        Attempts to reteive the string portion of a message... tries to handle multipart messages as well. This seems to be working so far with my tests but could use some tweaking later as more types of mail servers are used with this feature.
        Parameters:
        msg - a Message object.
        Returns:
        The text portion of an email with each line being an element of the list.
        Throws:
        javax.mail.MessagingException - if any.
        java.io.IOException - if any.
      • isDeleteOnClose

        public java.lang.Boolean isDeleteOnClose()

        isDeleteOnClose

        Returns:
        a Boolean object.
      • setDeleteOnClose

        public void setDeleteOnClose​(java.lang.Boolean deleteOnClose)

        setDeleteOnClose

        Parameters:
        deleteOnClose - a Boolean object.
      • string2Lines

        public static java.util.List<java.lang.String> string2Lines​(java.lang.String text)

        string2Lines

        Parameters:
        text - a String object.
        Returns:
        a List object.