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.ReadOnlyMessage
The 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.Enumeration
getAllHeaderLines()
Causes the headers to be read.java.util.Enumeration
getAllHeaders()
Causes the headers to be read.protected java.io.InputStream
getContentStream()
Causes the content to be read in.javax.activation.DataHandler
getDataHandler()
Causes the content to be read in.java.lang.String[]
getHeader(java.lang.String name)
Causes the headers to be read.java.lang.String
getHeader(java.lang.String name, java.lang.String delimiter)
Causes the headers to be read.java.util.Enumeration
getMatchingHeaderLines(java.lang.String[] names)
Causes the headers to be read.java.util.Enumeration
getMatchingHeaders(java.lang.String[] names)
Causes the headers to be read.java.util.Enumeration
getNonMatchingHeaderLines(java.lang.String[] names)
Causes the headers to be read.java.util.Enumeration
getNonMatchingHeaders(java.lang.String[] names)
Causes the headers to be read.int
getSize()
Gets the size of the message.java.lang.String
getUID()
Returns the unique ID for this message.void
setFlags(Flags flags, boolean set)
Set flags (but only DELETED is supported) add or remove the message from the folder deleted message list.void
writeTo(java.io.OutputStream msgStream)
Writes this message to the specified stream in RFC 822 format.void
writeTo(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 MessagingException
Causes the content to be read in.- Specified by:
getDataHandler
in interfacePart
- Overrides:
getDataHandler
in classMimeMessage
- Throws:
MessagingException
-
getContentStream
protected java.io.InputStream getContentStream() throws MessagingException
Causes the content to be read in.- Overrides:
getContentStream
in classMimeMessage
- Throws:
MessagingException
- See Also:
MimeBodyPart.getContentStream()
-
getSize
public int getSize() throws MessagingException
Gets the size of the message. Uses the cached size if it's available to us.- Specified by:
getSize
in interfacePart
- Overrides:
getSize
in classMimeMessage
- Throws:
MessagingException
-
getHeader
public java.lang.String[] getHeader(java.lang.String name) throws MessagingException
Causes the headers to be read.- Specified by:
getHeader
in interfacePart
- Overrides:
getHeader
in classMimeMessage
- Parameters:
name
- the header name- Throws:
MessagingException
-
getHeader
public java.lang.String getHeader(java.lang.String name, java.lang.String delimiter) throws MessagingException
Causes the headers to be read.- Specified by:
getHeader
in interfaceMimePart
- Overrides:
getHeader
in classMimeMessage
- Parameters:
name
- the header namedelimiter
- the delimiter- Throws:
MessagingException
-
getAllHeaders
public java.util.Enumeration getAllHeaders() throws MessagingException
Causes the headers to be read.- Specified by:
getAllHeaders
in interfacePart
- Overrides:
getAllHeaders
in classMimeMessage
- Returns:
- an Enumeration of Header objects
- Throws:
MessagingException
-
getAllHeaderLines
public java.util.Enumeration getAllHeaderLines() throws MessagingException
Causes the headers to be read.- Specified by:
getAllHeaderLines
in interfaceMimePart
- Overrides:
getAllHeaderLines
in classMimeMessage
- Returns:
- an Enumeration of Strings
- Throws:
MessagingException
-
getMatchingHeaders
public java.util.Enumeration getMatchingHeaders(java.lang.String[] names) throws MessagingException
Causes the headers to be read.- Specified by:
getMatchingHeaders
in interfacePart
- Overrides:
getMatchingHeaders
in 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 MessagingException
Causes the headers to be read.- Specified by:
getMatchingHeaderLines
in interfaceMimePart
- Overrides:
getMatchingHeaderLines
in classMimeMessage
- Returns:
- an Enumeration of Strings
- Throws:
MessagingException
-
getNonMatchingHeaders
public java.util.Enumeration getNonMatchingHeaders(java.lang.String[] names) throws MessagingException
Causes the headers to be read.- Specified by:
getNonMatchingHeaders
in interfacePart
- Overrides:
getNonMatchingHeaders
in 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 MessagingException
Causes the headers to be read.- Specified by:
getNonMatchingHeaderLines
in interfaceMimePart
- Overrides:
getNonMatchingHeaderLines
in classMimeMessage
- Returns:
- an Enumeration of Strings
- Throws:
MessagingException
-
writeTo
public void writeTo(java.io.OutputStream msgStream) throws java.io.IOException, MessagingException
Description copied from class:MimeMessage
Writes this message to the specified stream in RFC 822 format.- Specified by:
writeTo
in interfacePart
- Overrides:
writeTo
in 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, MessagingException
Description copied from class:MimeMessage
Writes this message to the specified stream in RFC 822 format, without the specified headers.- Overrides:
writeTo
in 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 MessagingException
Returns 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:
setFlags
in 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
-
-