org.opennms.javamail
Class JavaReadMailer
java.lang.Object
org.opennms.javamail.JavaMailer2
org.opennms.javamail.JavaReadMailer
public class JavaReadMailer
- extends JavaMailer2
JavaMail implementation for reading electronic mail.
- Author:
- David Hustace
JavaReadMailer
public JavaReadMailer(ReadmailConfig config,
Boolean closeOnDelete)
throws JavaMailerException
- Throws:
JavaMailerException
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<Message> retrieveMessages()
throws JavaMailerException
- Throws:
JavaMailerException
retrieveMessages
public List<Message> retrieveMessages(SearchTerm term)
throws JavaMailerException
- Parameters:
term -
- Throws:
JavaMailerException
getMessages
public List<Message> getMessages()
getText
public static List<String> getText(Message msg)
throws 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 -
- Returns:
- The text portion of an email with each line being an element of the list.
- Throws:
MessagingException
IOException
isDeleteOnClose
public Boolean isDeleteOnClose()
setDeleteOnClose
public void setDeleteOnClose(Boolean deleteOnClose)
string2Lines
public static List<String> string2Lines(String text)
Copyright © 2009. All Rights Reserved.