| java.lang.Object | |||
| ↳ | com.google.code.javax.mail.Service | ||
| ↳ | com.google.code.javax.mail.Store | ||
| ↳ | com.google.code.com.sun.mail.imap.IMAPStore | ||
Known Direct Subclasses
|
This class provides access to an IMAP message store.
Applications that need to make use of IMAP-specific features may cast
a Store object to an IMAPStore object and
use the methods on this class. The getQuota and
setQuota methods support the IMAP QUOTA extension.
Refer to RFC 2087
for more information.
See the com.sun.mail.imap package documentation for further information on the IMAP protocol provider.
WARNING: The APIs unique to this class should be considered EXPERIMENTAL. They may be changed in the future in ways that are incompatible with applications using the current APIs.
| Constants | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| int | RESPONSE | A special event type for a StoreEvent to indicate an IMAP response, if the mail.imap.enableimapevents property is set. | |||||||||
| Fields | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| appendBufferSize | |||||||||||
| authorizationID | |||||||||||
| blksize | |||||||||||
| connectionFailed | |||||||||||
| connectionFailedLock | |||||||||||
| defaultPort | |||||||||||
| disableAuthLogin | |||||||||||
| disableAuthNtlm | |||||||||||
| disableAuthPlain | |||||||||||
| enableImapEvents | |||||||||||
| enableSASL | |||||||||||
| enableStartTLS | |||||||||||
| folderConstructor | |||||||||||
| folderConstructorLI | |||||||||||
| forceClose | |||||||||||
| forcePasswordRefresh | |||||||||||
| guid | |||||||||||
| host | |||||||||||
| isSSL | |||||||||||
| messageCacheDebug | |||||||||||
| minIdleTime | |||||||||||
| name | |||||||||||
| namespaces | |||||||||||
| nonStoreResponseHandler | A special response handler for connections that are being used to perform operations on behalf of an object other than the Store. | ||||||||||
| out | |||||||||||
| password | |||||||||||
| pool | |||||||||||
| port | |||||||||||
| proxyAuthUser | |||||||||||
| requireStartTLS | |||||||||||
| saslMechanisms | |||||||||||
| saslRealm | |||||||||||
| statusCacheTimeout | |||||||||||
| user | |||||||||||
|
[Expand]
Inherited Fields | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.google.code.javax.mail.Store
| |||||||||||
From class
com.google.code.javax.mail.Service
| |||||||||||
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Constructor that takes a Session object and a URLName that
represents a specific IMAP server.
| |||||||||||
| Protected Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Constructor used by this class and by IMAPSSLStore subclass.
| |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Close this Store.
| |||||||||||
Get the default folder, representing the root of this user's
namespace.
| |||||||||||
Get named folder.
| |||||||||||
Get named folder.
| |||||||||||
Using the IMAP NAMESPACE command (RFC 2342), return a set
of folders representing the Personal namespaces.
| |||||||||||
Get the quotas for the named quota root.
| |||||||||||
Using the IMAP NAMESPACE command (RFC 2342), return a set
of folders representing the Shared namespaces.
| |||||||||||
Using the IMAP NAMESPACE command (RFC 2342), return a set
of folders representing the User's namespaces.
| |||||||||||
Response handler method.
| |||||||||||
Return true if the specified capability string is in the list
of capabilities the server announced.
| |||||||||||
Use the IMAP IDLE command (see
RFC 2177),
if supported by the server, to enter idle mode so that the server
can send unsolicited notifications
without the need for the client to constantly poll the server.
| |||||||||||
Check whether this store is connected.
| |||||||||||
Set the password that will be used for subsequent connections
after this Store is first connected (for example, when creating
a connection to open a GmailFolder).
| |||||||||||
Set the quotas for the quota root specified in the quota argument.
| |||||||||||
Set the user name that will be used for subsequent connections
after this Store is first connected (for example, when creating
a connection to open a GmailFolder).
| |||||||||||
| Protected Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Stop the event dispatcher thread so the queue can be garbage collected.
| |||||||||||
Create an IMAPFolder object.
| |||||||||||
Create an IMAPFolder object.
| |||||||||||
Create an IMAPFolder object.
| |||||||||||
This method is called after the connection is made and
TLS is started (if needed), but before any authentication
is attempted.
| |||||||||||
Implementation of protocolConnect().
| |||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.google.code.javax.mail.Store
| |||||||||||
From class
com.google.code.javax.mail.Service
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
com.google.code.com.sun.mail.iap.ResponseHandler
| |||||||||||
From interface
com.google.code.javax.mail.QuotaAwareStore
| |||||||||||
A special event type for a StoreEvent to indicate an IMAP response, if the mail.imap.enableimapevents property is set.
A special response handler for connections that are being used to perform operations on behalf of an object other than the Store. It DOESN'T cause the Store to be cleaned up if a BYE is seen. The BYE may be real or synthetic and in either case just indicates that the connection is dead.
Constructor that takes a Session object and a URLName that represents a specific IMAP server.
| session | |
|---|---|
| url |
Constructor used by this class and by IMAPSSLStore subclass.
| session | |
|---|---|
| url | |
| name | |
| isSSL |
Get the default folder, representing the root of this user's namespace. Returns a closed DefaultFolder object.
| MessagingException |
|---|
Get named folder. Returns a new, closed IMAPFolder.
| url | URLName that denotes a folder |
|---|
| MessagingException |
|---|
Get named folder. Returns a new, closed IMAPFolder.
| name | The name of the GmailFolder. In some Stores, name can be an absolute path if it starts with the hierarchy delimiter. Else it is interpreted relative to the 'root' of this namespace. |
|---|
| MessagingException |
|---|
Using the IMAP NAMESPACE command (RFC 2342), return a set of folders representing the Personal namespaces.
| MessagingException |
|---|
Get the quotas for the named quota root. Quotas are controlled on the basis of a quota root, not (necessarily) a folder. The relationship between folders and quota roots depends on the IMAP server. Some servers might implement a single quota root for all folders owned by a user. Other servers might implement a separate quota root for each folder. A single folder can even have multiple quota roots, perhaps controlling quotas for different resources.
| root | The name of the quota root |
|---|
| MessagingException | if the server doesn't support the QUOTA extension |
|---|
Using the IMAP NAMESPACE command (RFC 2342), return a set of folders representing the Shared namespaces.
| MessagingException |
|---|
Using the IMAP NAMESPACE command (RFC 2342), return a set of folders representing the User's namespaces.
| user |
|---|
| MessagingException |
|---|
Return true if the specified capability string is in the list of capabilities the server announced.
| capability |
|---|
| MessagingException |
|---|
Use the IMAP IDLE command (see
RFC 2177),
if supported by the server, to enter idle mode so that the server
can send unsolicited notifications
without the need for the client to constantly poll the server.
Use a ConnectionListener to be notified of
events. When another thread (e.g., the listener thread)
needs to issue an IMAP comand for this Store, the idle mode will
be terminated and this method will return. Typically the caller
will invoke this method in a loop.
If the mail.imap.enableimapevents property is set, notifications
received while the IDLE command is active will be delivered to
ConnectionListeners as events with a type of
IMAPStore.RESPONSE. The event's message will be
the raw IMAP response string.
Note that most IMAP servers will not deliver any events when
using the IDLE command on a connection with no mailbox selected
(i.e., this method). In most cases you'll want to use the
idle method on IMAPFolder.
NOTE: This capability is highly experimental and likely will change in future releases.
The mail.imap.minidletime property enforces a minimum delay before returning from this method, to ensure that other threads have a chance to issue commands before the caller invokes this method again. The default delay is 10 milliseconds.
| MessagingException | if the server doesn't support the IDLE extension |
|---|---|
| IllegalStateException | if the store isn't connected |
Check whether this store is connected. Override superclass method, to actually ping our server connection.
Set the password that will be used for subsequent connections after this Store is first connected (for example, when creating a connection to open a GmailFolder). This value is overridden by any call to the Store's connect method.
Most applications will never need to use this method.
| password |
|---|
Set the quotas for the quota root specified in the quota argument.
Typically this will be one of the quota roots obtained from the
getQuota method, but it need not be.
| quota | The quota to set |
|---|
| MessagingException | if the server doesn't support the QUOTA extension |
|---|
Set the user name that will be used for subsequent connections after this Store is first connected (for example, when creating a connection to open a GmailFolder). This value is overridden by any call to the Store's connect method.
Some IMAP servers may provide an authentication ID that can be used for more efficient authentication for future connections. This authentication ID is provided in a server-specific manner not described here.
Most applications will never need to use this method.
| user |
|---|
Stop the event dispatcher thread so the queue can be garbage collected.
| Throwable |
|---|
Create an IMAPFolder object. If user supplied their own class, use it. Otherwise, call the constructor.
| fullName | |
|---|---|
| separator | |
| isNamespace |
Create an IMAPFolder object. Call the newIMAPFolder method above with a null isNamespace.
| fullName | |
|---|---|
| separator |
Create an IMAPFolder object. If user supplied their own class, use it. Otherwise, call the constructor.
| li |
|---|
This method is called after the connection is made and TLS is started (if needed), but before any authentication is attempted. Subclasses can override this method to issue commands that are needed in the "not authenticated" state. Note that if the connection is pre-authenticated, this method won't be called.
The implementation of this method in this class does nothing.
| p |
|---|
| ProtocolException |
|---|
Implementation of protocolConnect(). Will create a connection to the server and authenticate the user using the mechanisms specified by various properties.
The host, user, and password
parameters must all be non-null. If the authentication mechanism
being used does not require a password, an empty string or other
suitable dummy password should be used.
| host | The name of the host to connect to |
|---|---|
| pport | The port to use (-1 means use default port) |
| user | The name of the user to login as |
| password | The user's password |
| MessagingException |
|---|