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 Throwable
        Finalizer to be sure and close with the appropriate mode any open folders
        Overrides:
        finalize in class Object
        Throws:
        Throwable
      • retrieveMessages

        public 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 List<javax.mail.Message> getMessages()

        getMessages

        Returns:
        a List object.
      • getText

        public static List<String> getText​(javax.mail.Message msg)
                                    throws javax.mail.MessagingException,
                                           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.
        IOException - if any.
      • isDeleteOnClose

        public Boolean isDeleteOnClose()

        isDeleteOnClose

        Returns:
        a Boolean object.
      • setDeleteOnClose

        public void setDeleteOnClose​(Boolean deleteOnClose)

        setDeleteOnClose

        Parameters:
        deleteOnClose - a Boolean object.
      • string2Lines

        public static List<String> string2Lines​(String text)

        string2Lines

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