This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.


com.sun.mail.pop3
class POP3Message

javax.mail.Message extended by javax.mail.internet.MimeMessage extended by com.sun.mail.pop3.POP3Message
All Implemented Interfaces:
Part, MimePart

public class POP3Message
extends MimeMessage

A POP3 Message. Just like a MimeMessage except that some things are not supported.


Nested Class Summary
 
Nested classes/interfaces inherited from class javax.mail.internet.MimeMessage
MimeMessage.RecipientType
 
Nested classes/interfaces inherited from class javax.mail.Message
Message.RecipientType
   
Field Summary
 
Fields inherited from class javax.mail.internet.MimeMessage
content, contentStream, dh, flags, headers, modified, saved
 
Fields inherited from class javax.mail.Message
expunged, folder, msgnum, session
 
Constructor Summary
POP3Message(Folder folder, int msgno)

          
 
Method Summary
 void
addHeader(String name, String value)

          Add this value to the existing values for this header_name.
 void

          Add a raw RFC822 header-line.
 Enumeration

          Get all header lines as an Enumeration of Strings.
 Enumeration

          Return all the headers from this Message as an enumeration of Header objects.
protected InputStream

          Produce the raw bytes of the content.
 String[]

          Get all the headers for this header_name.
 String
getHeader(String name, String delimiter)

          Get all the headers for this header name, returned as a single String, with headers separated by the delimiter.
 Enumeration

          Get matching header lines as an Enumeration of Strings.
 Enumeration

          Return matching headers from this Message as an Enumeration of Header objects.
 Enumeration

          Get non-matching header lines as an Enumeration of Strings.
 Enumeration

          Return non-matching headers from this Message as an Enumeration of Header objects.
 int

          Return the size of the content of this message in bytes.
 void
invalidate(boolean invalidateHeaders)

          Invalidate the cache of content for this message object, causing it to be fetched again from the server the next time it is needed.
 void

          Remove all headers with this name.
 void

          POP3 message can't be changed.
 void
setFlags(Flags newFlags, boolean set)

          Set the specified flags on this message to the specified value.
 void
setHeader(String name, String value)

          Set the value for this header_name.
 InputStream
top(int n)

          Fetch the header of the message and the first n lines of the raw content of the message.
 
Methods inherited from class javax.mail.internet.MimeMessage
addFrom, addHeader, addHeaderLine, addRecipients, addRecipients, createInternetHeaders, createMimeMessage, getAllHeaderLines, getAllHeaders, getAllRecipients, getContent, getContentID, getContentLanguage, getContentMD5, getContentStream, getContentType, getDataHandler, getDescription, getDisposition, getEncoding, getFileName, getFlags, getFrom, getHeader, getHeader, getInputStream, getLineCount, getMatchingHeaderLines, getMatchingHeaders, getMessageID, getNonMatchingHeaderLines, getNonMatchingHeaders, getRawInputStream, getReceivedDate, getRecipients, getReplyTo, getSender, getSentDate, getSize, getSubject, isMimeType, isSet, parse, removeHeader, reply, saveChanges, setContent, setContent, setContentID, setContentLanguage, setContentMD5, setDataHandler, setDescription, setDescription, setDisposition, setFileName, setFlags, setFrom, setFrom, setHeader, setRecipients, setRecipients, setReplyTo, setSender, setSentDate, setSubject, setSubject, setText, setText, setText, updateHeaders, updateMessageID, writeTo, writeTo
 
Methods inherited from class javax.mail.Message
addFrom, addRecipient, addRecipients, getAllRecipients, getFlags, getFolder, getFrom, getMessageNumber, getReceivedDate, getRecipients, getReplyTo, getSentDate, getSubject, isExpunged, isSet, match, reply, saveChanges, send, setExpunged, setFlag, setFlags, setFrom, setFrom, setMessageNumber, setRecipient, setRecipients, setReplyTo, setSentDate, setSubject
 

Constructor Detail

POP3Message

public POP3Message(Folder folder,
                   int msgno)
            throws MessagingException
Parameters:
folder
msgno
Throws:
MessagingException
Method Detail

addHeader

public void addHeader(String name,
                      String value)
               throws MessagingException
Add this value to the existing values for this header_name. Throws IllegalWriteException because POP3 messages are read-only.

Overrides:
addHeader in class MimeMessage
Parameters:
name - header name
value - header value
Throws:
MessagingException

addHeaderLine

public void addHeaderLine(String line)
                   throws MessagingException
Add a raw RFC822 header-line. Throws IllegalWriteException because POP3 messages are read-only.

Overrides:
addHeaderLine in class MimeMessage
Parameters:
line
Throws:
MessagingException

getAllHeaderLines

public Enumeration getAllHeaderLines()
                              throws MessagingException
Get all header lines as an Enumeration of Strings. A Header line is a raw RFC822 header-line, containing both the "name" and "value" field.

Overrides:
getAllHeaderLines in class MimeMessage
Throws:
MessagingException

getAllHeaders

public Enumeration getAllHeaders()
                          throws MessagingException
Return all the headers from this Message as an enumeration of Header objects.

Note that certain headers may be encoded as per RFC 2047 if they contain non US-ASCII characters and these should be decoded.

Overrides:
getAllHeaders in class MimeMessage
Returns:
array of header objects
Throws:
MessagingException

getContentStream

protected InputStream getContentStream()
                                throws MessagingException
Produce the raw bytes of the content. The data is fetched using the POP3 RETR command.

Overrides:
getContentStream in class MimeMessage
Throws:
MessagingException

getHeader

public String[] getHeader(String name)
                   throws MessagingException
Get all the headers for this header_name. Note that certain headers may be encoded as per RFC 2047 if they contain non US-ASCII characters and these should be decoded.

Overrides:
getHeader in class MimeMessage
Parameters:
name - name of header
Returns:
array of headers
Throws:
MessagingException

getHeader

public String getHeader(String name,
                        String delimiter)
                 throws MessagingException
Get all the headers for this header name, returned as a single String, with headers separated by the delimiter. If the delimiter is null, only the first header is returned.

Overrides:
getHeader in class MimeMessage
Parameters:
name - the name of this header
delimiter - delimiter between returned headers
Returns:
the value fields for all headers with this name
Throws:
MessagingException

getMatchingHeaderLines

public Enumeration getMatchingHeaderLines(String[] names)
                                   throws MessagingException
Get matching header lines as an Enumeration of Strings. A Header line is a raw RFC822 header-line, containing both the "name" and "value" field.

Overrides:
getMatchingHeaderLines in class MimeMessage
Parameters:
names
Throws:
MessagingException

getMatchingHeaders

public Enumeration getMatchingHeaders(String[] names)
                               throws MessagingException
Return matching headers from this Message as an Enumeration of Header objects.

Overrides:
getMatchingHeaders in class MimeMessage
Parameters:
names
Throws:
MessagingException

getNonMatchingHeaderLines

public Enumeration getNonMatchingHeaderLines(String[] names)
                                      throws MessagingException
Get non-matching header lines as an Enumeration of Strings. A Header line is a raw RFC822 header-line, containing both the "name" and "value" field.

Overrides:
getNonMatchingHeaderLines in class MimeMessage
Parameters:
names
Throws:
MessagingException

getNonMatchingHeaders

public Enumeration getNonMatchingHeaders(String[] names)
                                  throws MessagingException
Return non-matching headers from this Message as an Enumeration of Header objects.

Overrides:
getNonMatchingHeaders in class MimeMessage
Parameters:
names
Throws:
MessagingException

getSize

public int getSize()
            throws MessagingException
Return the size of the content of this message in bytes. Returns -1 if the size cannot be determined.

Note that this number may not be an exact measure of the content size and may or may not account for any transfer encoding of the content.

Overrides:
getSize in class MimeMessage
Returns:
size of content in bytes
Throws:
MessagingException

invalidate

public synchronized void invalidate(boolean invalidateHeaders)
Invalidate the cache of content for this message object, causing it to be fetched again from the server the next time it is needed. If invalidateHeaders is true, invalidate the headers as well.

Parameters:
invalidateHeaders - invalidate the headers as well?

removeHeader

public void removeHeader(String name)
                  throws MessagingException
Remove all headers with this name. Throws IllegalWriteException because POP3 messages are read-only.

Overrides:
removeHeader in class MimeMessage
Parameters:
name
Throws:
MessagingException

saveChanges

public void saveChanges()
                 throws MessagingException
POP3 message can't be changed. This method throws IllegalWriteException.

Overrides:
saveChanges in class MimeMessage
Throws:
MessagingException

setFlags

public void setFlags(Flags newFlags,
                     boolean set)
              throws MessagingException
Set the specified flags on this message to the specified value.

Overrides:
setFlags in class MimeMessage
Parameters:
newFlags - the flags to be set
set - the value to be set
Throws:
MessagingException

setHeader

public void setHeader(String name,
                      String value)
               throws MessagingException
Set the value for this header_name. Throws IllegalWriteException because POP3 messages are read-only.

Overrides:
setHeader in class MimeMessage
Parameters:
name - header name
value - header value
Throws:
MessagingException

top

public InputStream top(int n)
                throws MessagingException
Fetch the header of the message and the first n lines of the raw content of the message. The headers and data are available in the returned InputStream.

Parameters:
n - number of lines of content to fetch
Returns:
InputStream containing the message headers and n content lines
Throws:
MessagingException


This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.
This page displays the Jadeite version of the documention. The official Sun™ documentation can be found here at http://java.sun.com/products/javamail/javadocs/index.html.