Package org.eclipse.angus.mail.gimap
In general, applications should not need to use the classes in this
package directly. Instead, they should use the APIs defined by the
jakarta.mail
package (and subpackages). Applications should
never construct instances of GmailStore
or
GmailFolder
directly. Instead, they should use the
Session
method getStore
to acquire an
appropriate Store
object, and from that acquire
Folder
objects.
Message objects returned by this provider may be cast to GmailMessage to access Gmail-specific data, e.g., using the methods GmailMessage.getMsgId(), GmailMessage.getThrId(), and GmailMessage.getLabels(). For example:
GmailMessage gmsg = (GmailMessage)msg; System.out.println("Gmail message ID is " + gmsg.getMsgId()); String[] labels = gmsg.getLabels(); for (String s : labels) System.out.println("Gmail message label: " + s);
Gmail-specific data may be prefetched using the GmailFolder.FetchProfileItems MSGID, THRID, and LABELS. For example:
FetchProfile fp = new FetchProfile(); fp.add(GmailFolder.FetchProfileItem.MSGID); folder.fetch(fp);
You can search using Gmail-specific data using the GmailMsgIdTerm, GmailThrIdTerm, and GmailRawSearchTerm search terms. For example:
// find the message with this Gmail unique message ID long msgid = ...; Message[] msgs = folder.search(new GmailMsgIdTerm(msgid));
You can access the Gmail extended attributes (returned by XLIST) for a folder using the IMAPFolder.getAttributes() method. For example:
IMAPFolder ifolder = (IMAPFolder)folder; String[] attrs = ifolder.getAttributes(); for (String s : attrs) System.out.println("Folder attribute: " + s);
WARNING: The APIs unique to this package should be considered EXPERIMENTAL. They may be changed in the future in ways that are incompatible with applications using the current APIs.
-
ClassDescriptionA Gmail folder.A fetch profile item for fetching headers.A Gmail message.This class implements searching for the Gmail message ID.The Gmail IMAP protocol provider.This class implements searching using the Gmail X-GM-RAW extension.The Gmail IMAP protocol provider.Support "gimaps" protocol name.A Gmail Store.This class implements searching for the Gmail thread ID.