public class IMAPStore extends Store implements QuotaAwareStore
| Constructor and Description |
|---|
IMAPStore(Session session,
URLName url)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the connection.
|
protected IMAPConnection |
getConnection()
Returns the IMAP connection used by this store.
|
Folder |
getDefaultFolder()
Returns the root folder.
|
Folder |
getFolder(java.lang.String name)
Returns the folder with the specified name.
|
Folder |
getFolder(URLName urlname)
Returns the folder whose name is the file part of the specified URLName.
|
Folder[] |
getPersonalNamespaces()
Returns a list of folders representing personal namespaces.
|
Quota[] |
getQuota(java.lang.String root)
Returns the quota for the specified quota root.
|
Folder[] |
getSharedNamespaces()
Returns a list of folders representing shared namespaces.
|
protected javax.net.ssl.TrustManager |
getTrustManager()
Returns a trust manager used for TLS negotiation.
|
Folder[] |
getUserNamespaces()
Returns a list of folders representing other users' namespaces.
|
boolean |
isConnected()
Uses a NOOP to ensure that the connection to the IMAP server is still
valid.
|
protected boolean |
isSelected(IMAPFolder folder)
Indicates whether the specified folder is selected.
|
protected void |
processAlert(java.lang.String message)
Process an alert supplied by the server.
|
protected boolean |
protocolConnect(java.lang.String host,
int port,
java.lang.String username,
java.lang.String password)
Connects to the IMAP server and authenticates with the specified
parameters.
|
void |
setQuota(Quota quota)
Sets the quota resource set for the specified quota root.
|
protected void |
setSelected(IMAPFolder folder)
Sets the selected folder.
|
addFolderListener, addStoreListener, getUserNamespaces, notifyFolderListeners, notifyFolderRenamedListeners, notifyStoreListeners, removeFolderListener, removeStoreListeneraddConnectionListener, connect, connect, connect, connect, getURLName, notifyConnectionListeners, queueEvent, removeConnectionListener, setConnected, setURLName, toStringprotected boolean protocolConnect(java.lang.String host,
int port,
java.lang.String username,
java.lang.String password)
throws MessagingException
protocolConnect in class Servicehost - the name of the host to connect toport - the port to use (-1 for the default port)username - the usernamepassword - the passwordAuthenticationFailedException - on authentication failureMessagingException - for non-authentication failuresprotected javax.net.ssl.TrustManager getTrustManager()
throws MessagingException
MessagingExceptionpublic void close()
throws MessagingException
close in class ServiceMessagingExceptionpublic Folder getDefaultFolder() throws MessagingException
getDefaultFolder in class StoreMessagingExceptionpublic Folder getFolder(java.lang.String name) throws MessagingException
getFolder in class Storename - the folder nameMessagingExceptionpublic Folder getFolder(URLName urlname) throws MessagingException
getFolder in class Storeurlname - a URLName denoting a folderMessagingExceptionpublic boolean isConnected()
isConnected in class Serviceprotected IMAPConnection getConnection()
throws StoreClosedException
StoreClosedException - if the store is not currently connectedprotected boolean isSelected(IMAPFolder folder)
protected void setSelected(IMAPFolder folder)
protected void processAlert(java.lang.String message)
public Folder[] getPersonalNamespaces() throws MessagingException
getPersonalNamespaces in class StoreMessagingExceptionpublic Folder[] getUserNamespaces() throws MessagingException
MessagingExceptionpublic Folder[] getSharedNamespaces() throws MessagingException
getSharedNamespaces in class StoreMessagingExceptionpublic Quota[] getQuota(java.lang.String root) throws MessagingException
getQuota in interface QuotaAwareStoreroot - the quota rootMessagingException - if the QUOTA extension is not supportedpublic void setQuota(Quota quota) throws MessagingException
setQuota in interface QuotaAwareStorequota - the mail quotaMessagingException - if the QUOTA extension is not supported