See: Description
Class | Description |
---|---|
GmailFolder |
A Gmail folder.
|
GmailFolder.FetchProfileItem |
A fetch profile item for fetching headers.
|
GmailMessage |
A Gmail message.
|
GmailMsgIdTerm |
This class implements searching for the Gmail message ID.
|
GmailRawSearchTerm |
This class implements searching using the Gmail X-GM-RAW extension.
|
GmailSSLStore |
Support "gimaps" protocol name.
|
GmailStore |
A Gmail Store.
|
GmailThrIdTerm |
This class implements searching for the Gmail thread ID.
|
In general, applications should not need to use the classes in this
package directly. Instead, they should use the APIs defined by the
javax.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.
Copyright © 1996-2017, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.