Package com.sun.mail.gimap
Class GmailMessage
java.lang.Object
javax.mail.Message
javax.mail.internet.MimeMessage
com.sun.mail.imap.IMAPMessage
com.sun.mail.gimap.GmailMessage
- All Implemented Interfaces:
ReadableMime
,MimePart
,Part
A Gmail message. Adds methods to access Gmail-specific per-message data.
- Since:
- JavaMail 1.4.6
- Author:
- Bill Shannon
-
Nested Class Summary
Nested classes/interfaces inherited from class com.sun.mail.imap.IMAPMessage
IMAPMessage.FetchProfileCondition
Nested classes/interfaces inherited from class javax.mail.internet.MimeMessage
MimeMessage.RecipientType
-
Field Summary
Fields inherited from class com.sun.mail.imap.IMAPMessage
bs, envelope, items, sectionId
Fields inherited from class javax.mail.internet.MimeMessage
cachedContent, content, contentStream, dh, flags, headers, modified, saved
Fields inherited from interface javax.mail.Part
ATTACHMENT, INLINE
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
GmailMessage
(IMAPFolder folder, int msgnum) Constructor.protected
GmailMessage
(Session session) Constructor, for use by IMAPNestedMessage. -
Method Summary
Methods inherited from class com.sun.mail.imap.IMAPMessage
addFrom, addHeader, addHeaderLine, addRecipients, checkExpunged, fetchItem, forceCheckExpunged, getAllHeaderLines, getAllHeaders, getContentID, getContentLanguage, getContentMD5, getContentStream, getContentType, getDataHandler, getDescription, getDisposition, getEncoding, getFetchBlockSize, getFileName, getFlags, getFrom, getHeader, getHeader, getInReplyTo, getItem, getLineCount, getMatchingHeaderLines, getMatchingHeaders, getMessageCacheLock, getMessageID, getMimeStream, getModSeq, getNonMatchingHeaderLines, getNonMatchingHeaders, getPeek, getProtocol, getReceivedDate, getRecipients, getReplyTo, getSender, getSentDate, getSequenceNumber, getSize, getSizeLong, getSubject, getUID, handleExtensionFetchItems, handleFetchItem, ignoreBodyStructureSize, invalidateHeaders, isREV1, isSet, removeHeader, setContentID, setContentLanguage, setContentMD5, setDataHandler, setDescription, setDisposition, setExpunged, setFileName, setFlags, setFrom, setHeader, setMessageNumber, setPeek, setRecipients, setReplyTo, setSender, setSentDate, setSubject, setUID, writeTo
Methods inherited from class javax.mail.internet.MimeMessage
addRecipients, createInternetHeaders, createMimeMessage, getAllRecipients, getContent, getInputStream, getRawInputStream, isMimeType, parse, reply, reply, saveChanges, setContent, setContent, setDescription, setFrom, setFrom, setRecipients, setSubject, setText, setText, setText, updateHeaders, updateMessageID, writeTo
Methods inherited from class javax.mail.Message
addRecipient, getFolder, getMessageNumber, getSession, isExpunged, match, setFlag, setRecipient
-
Constructor Details
-
GmailMessage
Constructor.- Parameters:
folder
- the containing foldermsgnum
- the message sequence number
-
GmailMessage
Constructor, for use by IMAPNestedMessage.- Parameters:
session
- the Session
-
-
Method Details
-
getMsgId
Return the Gmail unique message ID.- Returns:
- the message ID
- Throws:
MessagingException
- for failures
-
getThrId
Return the Gmail unique thread ID.- Returns:
- the thread ID
- Throws:
MessagingException
- for failures
-
getLabels
Return the Gmail labels associated with this message.- Returns:
- array of labels, or empty array if none
- Throws:
MessagingException
- for failures
-
setLabels
Set/Unset the given labels on this message.- Parameters:
labels
- the labels to add or removeset
- true to add labels, false to remove- Throws:
MessagingException
- for failures- Since:
- JavaMail 1.5.5
-
clearCachedLabels
public void clearCachedLabels()Clear any cached labels for this message. The Gmail labels for a messge will be cached when first accessed using either the fetch method or the getLabels method. Gmail provides no notification when the labels have been changed by another application so applications may need to clear the cache if accessing the labels for a message more than once while the Folder is open.- Since:
- JavaMail 1.5.6
-