Package gnu.mail.providers.pop3
Class POP3Message
- java.lang.Object
-
- javax.mail.Message
-
- javax.mail.internet.MimeMessage
-
- gnu.mail.providers.ReadOnlyMessage
-
- gnu.mail.providers.pop3.POP3Message
-
public final class POP3Message extends gnu.mail.providers.ReadOnlyMessageThe message class implementing the POP3 mail protocol.- Version:
- 1.2
- Author:
- Chris Burdess, Nic Ferrier
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class javax.mail.internet.MimeMessage
MimeMessage.RecipientType
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.EnumerationgetAllHeaderLines()Causes the headers to be read.java.util.EnumerationgetAllHeaders()Causes the headers to be read.protected java.io.InputStreamgetContentStream()Causes the content to be read in.javax.activation.DataHandlergetDataHandler()Causes the content to be read in.java.lang.String[]getHeader(java.lang.String name)Causes the headers to be read.java.lang.StringgetHeader(java.lang.String name, java.lang.String delimiter)Causes the headers to be read.java.util.EnumerationgetMatchingHeaderLines(java.lang.String[] names)Causes the headers to be read.java.util.EnumerationgetMatchingHeaders(java.lang.String[] names)Causes the headers to be read.java.util.EnumerationgetNonMatchingHeaderLines(java.lang.String[] names)Causes the headers to be read.java.util.EnumerationgetNonMatchingHeaders(java.lang.String[] names)Causes the headers to be read.intgetSize()Gets the size of the message.java.lang.StringgetUID()Returns the unique ID for this message.voidsetFlags(Flags flags, boolean set)Set flags (but only DELETED is supported) add or remove the message from the folder deleted message list.voidwriteTo(java.io.OutputStream msgStream)Writes this message to the specified stream in RFC 822 format.voidwriteTo(java.io.OutputStream msgStream, java.lang.String[] ignoreList)Writes this message to the specified stream in RFC 822 format, without the specified headers.-
Methods inherited from class gnu.mail.providers.ReadOnlyMessage
addHeader, addHeaderLine, removeHeader, saveChanges, setContent, setContent, setHeader
-
Methods inherited from class javax.mail.internet.MimeMessage
addFrom, addRecipients, addRecipients, createInternetHeaders, createMimeMessage, getAllRecipients, getContent, getContentID, getContentLanguage, getContentMD5, getContentType, getDescription, getDisposition, getEncoding, getFileName, getFlags, getFrom, getInputStream, getLineCount, getMessageID, getRawInputStream, getReceivedDate, getRecipients, getReplyTo, getSender, getSentDate, getSubject, isMimeType, isSet, parse, reply, setContentID, setContentLanguage, setContentMD5, setDataHandler, setDescription, setDescription, setDisposition, setFileName, setFrom, setFrom, setRecipients, setRecipients, setReplyTo, setSender, setSentDate, setSubject, setSubject, setText, setText, setText, updateHeaders, updateMessageId
-
Methods inherited from class javax.mail.Message
addRecipient, getFolder, getMessageNumber, isExpunged, match, setExpunged, setFlag, setMessageNumber, setRecipient
-
-
-
-
Method Detail
-
getDataHandler
public javax.activation.DataHandler getDataHandler() throws MessagingExceptionCauses the content to be read in.- Specified by:
getDataHandlerin interfacePart- Overrides:
getDataHandlerin classMimeMessage- Throws:
MessagingException
-
getContentStream
protected java.io.InputStream getContentStream() throws MessagingExceptionCauses the content to be read in.- Overrides:
getContentStreamin classMimeMessage- Throws:
MessagingException- See Also:
MimeBodyPart.getContentStream()
-
getSize
public int getSize() throws MessagingExceptionGets the size of the message. Uses the cached size if it's available to us.- Specified by:
getSizein interfacePart- Overrides:
getSizein classMimeMessage- Throws:
MessagingException
-
getHeader
public java.lang.String[] getHeader(java.lang.String name) throws MessagingExceptionCauses the headers to be read.- Specified by:
getHeaderin interfacePart- Overrides:
getHeaderin classMimeMessage- Parameters:
name- the header name- Throws:
MessagingException
-
getHeader
public java.lang.String getHeader(java.lang.String name, java.lang.String delimiter) throws MessagingExceptionCauses the headers to be read.- Specified by:
getHeaderin interfaceMimePart- Overrides:
getHeaderin classMimeMessage- Parameters:
name- the header namedelimiter- the delimiter- Throws:
MessagingException
-
getAllHeaders
public java.util.Enumeration getAllHeaders() throws MessagingExceptionCauses the headers to be read.- Specified by:
getAllHeadersin interfacePart- Overrides:
getAllHeadersin classMimeMessage- Returns:
- an Enumeration of Header objects
- Throws:
MessagingException
-
getAllHeaderLines
public java.util.Enumeration getAllHeaderLines() throws MessagingExceptionCauses the headers to be read.- Specified by:
getAllHeaderLinesin interfaceMimePart- Overrides:
getAllHeaderLinesin classMimeMessage- Returns:
- an Enumeration of Strings
- Throws:
MessagingException
-
getMatchingHeaders
public java.util.Enumeration getMatchingHeaders(java.lang.String[] names) throws MessagingExceptionCauses the headers to be read.- Specified by:
getMatchingHeadersin interfacePart- Overrides:
getMatchingHeadersin classMimeMessage- Parameters:
names- the header names to match- Returns:
- an Enumeration of Header objects
- Throws:
MessagingException
-
getMatchingHeaderLines
public java.util.Enumeration getMatchingHeaderLines(java.lang.String[] names) throws MessagingExceptionCauses the headers to be read.- Specified by:
getMatchingHeaderLinesin interfaceMimePart- Overrides:
getMatchingHeaderLinesin classMimeMessage- Returns:
- an Enumeration of Strings
- Throws:
MessagingException
-
getNonMatchingHeaders
public java.util.Enumeration getNonMatchingHeaders(java.lang.String[] names) throws MessagingExceptionCauses the headers to be read.- Specified by:
getNonMatchingHeadersin interfacePart- Overrides:
getNonMatchingHeadersin classMimeMessage- Parameters:
names- the header names to ignore- Returns:
- an Enumeration of Header objects
- Throws:
MessagingException
-
getNonMatchingHeaderLines
public java.util.Enumeration getNonMatchingHeaderLines(java.lang.String[] names) throws MessagingExceptionCauses the headers to be read.- Specified by:
getNonMatchingHeaderLinesin interfaceMimePart- Overrides:
getNonMatchingHeaderLinesin classMimeMessage- Returns:
- an Enumeration of Strings
- Throws:
MessagingException
-
writeTo
public void writeTo(java.io.OutputStream msgStream) throws java.io.IOException, MessagingExceptionDescription copied from class:MimeMessageWrites this message to the specified stream in RFC 822 format.- Specified by:
writeToin interfacePart- Overrides:
writeToin classMimeMessage- Throws:
java.io.IOException- if an error occurs writing to the stream or in the data handler layerMessagingException- if an error occurs fetching the data to be written
-
writeTo
public void writeTo(java.io.OutputStream msgStream, java.lang.String[] ignoreList) throws java.io.IOException, MessagingExceptionDescription copied from class:MimeMessageWrites this message to the specified stream in RFC 822 format, without the specified headers.- Overrides:
writeToin classMimeMessage- Throws:
java.io.IOException- if an error occurs writing to the stream or in the data handler layerMessagingException
-
getUID
public java.lang.String getUID() throws MessagingExceptionReturns the unique ID for this message.- Throws:
MessagingException
-
setFlags
public void setFlags(Flags flags, boolean set) throws MessagingException
Set flags (but only DELETED is supported) add or remove the message from the folder deleted message list.- Overrides:
setFlagsin classgnu.mail.providers.ReadOnlyMessage- Parameters:
flags- the flags to be setset- the value to be set- Throws:
IllegalWriteException- if the underlying implementation does not support modification of existing valuesMessagingException
-
-