|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.mail.Message javax.mail.internet.MimeMessage org.apache.geronimo.javamail.store.pop3.POP3Message
public class POP3Message
POP3 implementation of javax.mail.internet.MimeMessage Only the most basic information is given and Message objects created here is a light-weight reference to the actual Message As per the JavaMail spec items from the actual message will get filled up on demand If some other items are obtained from the server as a result of one call, then the other details are also processed and filled in. For ex if RETR is called then header information will also be processed in addition to the content
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.mail.internet.MimeMessage |
---|
MimeMessage.RecipientType |
Field Summary | |
---|---|
protected int |
headerSize
|
protected byte[] |
messageData
|
protected int |
msgSize
|
protected String |
uid
|
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 |
Fields inherited from interface javax.mail.Part |
---|
ATTACHMENT, INLINE |
Constructor Summary | |
---|---|
protected |
POP3Message(Folder folder,
int msgnum)
Create a new POP3 message associated with a folder. |
Method Summary | |
---|---|
void |
addHeader(String name,
String value)
|
void |
addHeaderLine(String line)
|
Enumeration |
getAllHeaderLines()
|
Enumeration |
getAllHeaders()
|
protected POP3Connection |
getConnection()
get the current connection pool attached to the folder. |
protected InputStream |
getContentStream()
Get an InputStream for reading the message content. |
String[] |
getHeader(String name)
|
String |
getHeader(String name,
String delimiter)
|
Enumeration |
getMatchingHeaderLines(String[] names)
|
Enumeration |
getMatchingHeaders(String[] names)
|
Enumeration |
getNonMatchingHeaderLines(String[] names)
|
Enumeration |
getNonMatchingHeaders(String[] names)
|
int |
getSize()
Get the size of the message. |
protected String |
getUID()
Retrieve the message UID from the server. |
protected void |
loadContent()
Lazy loading of the message content. |
protected void |
loadContent(ByteArrayInputStream stream)
Load the message content from the server. |
protected void |
loadHeaders()
notice that we pass zero as the no of lines from the message,as it doesn't serv any purpose to get only a certain number of lines. |
protected void |
loadHeaders(InputStream in)
Unconditionally load the headers from an inputstream. |
protected void |
releaseConnection(POP3Connection connection)
Release the connection back to the Folder after performing an operation that requires a connection. |
void |
removeHeader(String name)
|
void |
saveChanges()
We cannot modify these messages |
void |
setFlags(Flags newFlags,
boolean set)
Set a flag value for this Message. |
void |
setHeader(String name,
String value)
|
void |
writeTo(OutputStream out)
Write out the byte data to the provided output stream. |
Methods inherited from class javax.mail.Message |
---|
addRecipient, getFolder, getMessageNumber, isExpunged, match, setExpunged, setFlag, setMessageNumber, setRecipient |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected int msgSize
protected int headerSize
protected String uid
protected byte[] messageData
Constructor Detail |
---|
protected POP3Message(Folder folder, int msgnum)
folder
- The owning folder.msgnum
- The message sequence number in the folder.Method Detail |
---|
protected InputStream getContentStream() throws MessagingException
getContentStream
in class MimeMessage
MessagingException
public void writeTo(OutputStream out) throws IOException, MessagingException
writeTo
in interface Part
writeTo
in class MimeMessage
out
- The target stream.
IOException
MessagingException
public void setFlags(Flags newFlags, boolean set) throws MessagingException
setFlags
in class MimeMessage
newFlags
- The new flag values.set
- Indicates whether this is a set or an unset operation.
MessagingException
protected void loadHeaders(InputStream in) throws MessagingException
in
- The InputStream with the header data.
MessagingException
protected void loadContent() throws MessagingException
MessagingException
protected void loadContent(ByteArrayInputStream stream) throws MessagingException
stream
- A ByteArrayInputStream containing the message content.
We explicitly use ByteArrayInputStream because
there are some optimizations that can take advantage
of the fact it is such a stream.
MessagingException
public int getSize() throws MessagingException
getSize
in interface Part
getSize
in class MimeMessage
MessagingException
protected void loadHeaders() throws MessagingException
MessagingException
protected String getUID() throws MessagingException
MessagingException
public String[] getHeader(String name) throws MessagingException
getHeader
in interface Part
getHeader
in class MimeMessage
MessagingException
public String getHeader(String name, String delimiter) throws MessagingException
getHeader
in interface MimePart
getHeader
in class MimeMessage
MessagingException
public Enumeration getAllHeaders() throws MessagingException
getAllHeaders
in interface Part
getAllHeaders
in class MimeMessage
MessagingException
public Enumeration getMatchingHeaders(String[] names) throws MessagingException
getMatchingHeaders
in interface Part
getMatchingHeaders
in class MimeMessage
MessagingException
public Enumeration getNonMatchingHeaders(String[] names) throws MessagingException
getNonMatchingHeaders
in interface Part
getNonMatchingHeaders
in class MimeMessage
MessagingException
public Enumeration getAllHeaderLines() throws MessagingException
getAllHeaderLines
in interface MimePart
getAllHeaderLines
in class MimeMessage
MessagingException
public Enumeration getMatchingHeaderLines(String[] names) throws MessagingException
getMatchingHeaderLines
in interface MimePart
getMatchingHeaderLines
in class MimeMessage
MessagingException
public Enumeration getNonMatchingHeaderLines(String[] names) throws MessagingException
getNonMatchingHeaderLines
in interface MimePart
getNonMatchingHeaderLines
in class MimeMessage
MessagingException
public void addHeader(String name, String value) throws MessagingException
addHeader
in interface Part
addHeader
in class MimeMessage
MessagingException
public void setHeader(String name, String value) throws MessagingException
setHeader
in interface Part
setHeader
in class MimeMessage
MessagingException
public void removeHeader(String name) throws MessagingException
removeHeader
in interface Part
removeHeader
in class MimeMessage
MessagingException
public void addHeaderLine(String line) throws MessagingException
addHeaderLine
in interface MimePart
addHeaderLine
in class MimeMessage
MessagingException
public void saveChanges() throws MessagingException
saveChanges
in class MimeMessage
MessagingException
protected POP3Connection getConnection() throws MessagingException
MessagingException
protected void releaseConnection(POP3Connection connection) throws MessagingException
connection
- The previously acquired connection.
MessagingException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |