gnu.mail.providers.imap

Class IMAPStore

public class IMAPStore extends Store

The storage class implementing the IMAP4rev1 mail protocol.

Author: Chris Burdess

Field Summary
protected IMAPConnectionconnection
The connection to the IMAP server.
protected IMAPFolderroot
Folder representing the root namespace of the IMAP connection.
protected IMAPFolderselected
The currently selected folder.
Constructor Summary
IMAPStore(Session session, URLName url)
Constructor.
Method Summary
voidclose()
Closes the connection.
protected IMAPConnectiongetConnection()
Returns the IMAP connection used by this store.
FoldergetDefaultFolder()
Returns the root folder.
FoldergetFolder(String name)
Returns the folder with the specified name.
FoldergetFolder(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.
QuotagetQuota(String root)
Returns the quota for the specified quota root.
Folder[]getSharedNamespaces()
Returns a list of folders representing shared namespaces.
protected TrustManagergetTrustManager()
Returns a trust manager used for TLS negotiation.
Folder[]getUserNamespaces()
Returns a list of folders representing other users' namespaces.
protected booleanisSelected(IMAPFolder folder)
Indicates whether the specified folder is selected.
protected voidprocessAlerts()
Process any alerts supplied by the server.
protected booleanprotocolConnect(String host, int port, String username, String password)
Connects to the IMAP server and authenticates with the specified parameters.
voidsetQuota(String root, Resource[] resources)
Sets the quota resource set for the specified quota root.
protected voidsetSelected(IMAPFolder folder)
Sets the selected folder.

Field Detail

connection

protected IMAPConnection connection
The connection to the IMAP server.

root

protected IMAPFolder root
Folder representing the root namespace of the IMAP connection.

selected

protected IMAPFolder selected
The currently selected folder.

Constructor Detail

IMAPStore

public IMAPStore(Session session, URLName url)
Constructor.

Method Detail

close

public void close()
Closes the connection.

getConnection

protected IMAPConnection getConnection()
Returns the IMAP connection used by this store.

Throws: StoreClosedException if the store is not currently connected

getDefaultFolder

public Folder getDefaultFolder()
Returns the root folder.

getFolder

public Folder getFolder(String name)
Returns the folder with the specified name.

getFolder

public Folder getFolder(URLName urlname)
Returns the folder whose name is the file part of the specified URLName.

getPersonalNamespaces

public Folder[] getPersonalNamespaces()
Returns a list of folders representing personal namespaces. See RFC 2342 for details.

getQuota

public Quota getQuota(String root)
Returns the quota for the specified quota root.

Parameters: root the quota root

getSharedNamespaces

public Folder[] getSharedNamespaces()
Returns a list of folders representing shared namespaces. See RFC 2342 for details.

getTrustManager

protected TrustManager getTrustManager()
Returns a trust manager used for TLS negotiation.

getUserNamespaces

public Folder[] getUserNamespaces()
Returns a list of folders representing other users' namespaces. See RFC 2342 for details.

isSelected

protected boolean isSelected(IMAPFolder folder)
Indicates whether the specified folder is selected.

processAlerts

protected void processAlerts()
Process any alerts supplied by the server.

protocolConnect

protected boolean protocolConnect(String host, int port, String username, String password)
Connects to the IMAP server and authenticates with the specified parameters.

setQuota

public void setQuota(String root, Resource[] resources)
Sets the quota resource set for the specified quota root.

Parameters: root the quota root resources the quota resources to set

setSelected

protected void setSelected(IMAPFolder folder)
Sets the selected folder.
©