|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.mail.Service
javax.mail.Store
gnu.mail.providers.imap.IMAPStore
public class IMAPStore
The storage class implementing the IMAP4rev1 mail protocol.
Field Summary | |
---|---|
protected IMAPConnection |
connection
The connection to the IMAP server. |
protected IMAPFolder |
root
Folder representing the root namespace of the IMAP connection. |
protected IMAPFolder |
selected
The currently selected folder. |
Fields inherited from class javax.mail.Service |
---|
debug, session, url |
Constructor Summary | |
---|---|
IMAPStore(Session session,
URLName url)
Constructor. |
Method Summary | |
---|---|
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 |
processAlerts()
Process any alerts 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(java.lang.String root,
Quota.Resource[] resources)
Sets the quota resource set for the specified quota root. |
protected void |
setSelected(IMAPFolder folder)
Sets the selected folder. |
Methods inherited from class javax.mail.Store |
---|
addFolderListener, addStoreListener, getUserNamespaces, notifyFolderListeners, notifyFolderRenamedListeners, notifyStoreListeners, removeFolderListener, removeStoreListener |
Methods inherited from class javax.mail.Service |
---|
addConnectionListener, connect, connect, connect, connect, getURLName, notifyConnectionListeners, queueEvent, removeConnectionListener, setConnected, setURLName, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected IMAPConnection connection
protected IMAPFolder root
protected IMAPFolder selected
Constructor Detail |
---|
public IMAPStore(Session session, URLName url)
Method Detail |
---|
protected boolean protocolConnect(java.lang.String host, int port, java.lang.String username, java.lang.String password) throws MessagingException
protocolConnect
in class Service
host
- the name of the host to connect toport
- the port to use (-1 for the default port)username
- the usernamepassword
- the password
AuthenticationFailedException
- on authentication failure
MessagingException
- for non-authentication failuresprotected javax.net.ssl.TrustManager getTrustManager() throws MessagingException
MessagingException
public void close() throws MessagingException
close
in class Service
MessagingException
public Folder getDefaultFolder() throws MessagingException
getDefaultFolder
in class Store
MessagingException
public Folder getFolder(java.lang.String name) throws MessagingException
getFolder
in class Store
name
- the folder name
MessagingException
public Folder getFolder(URLName urlname) throws MessagingException
getFolder
in class Store
urlname
- a URLName denoting a folder
MessagingException
public boolean isConnected()
isConnected
in class Service
protected IMAPConnection getConnection() throws StoreClosedException
StoreClosedException
- if the store is not currently connectedprotected boolean isSelected(IMAPFolder folder)
protected void setSelected(IMAPFolder folder)
protected void processAlerts()
public Folder[] getPersonalNamespaces() throws MessagingException
getPersonalNamespaces
in class Store
MessagingException
public Folder[] getUserNamespaces() throws MessagingException
MessagingException
public Folder[] getSharedNamespaces() throws MessagingException
getSharedNamespaces
in class Store
MessagingException
public Quota getQuota(java.lang.String root) throws MessagingException
root
- the quota root
MessagingException
public void setQuota(java.lang.String root, Quota.Resource[] resources) throws MessagingException
root
- the quota rootresources
- the quota resources to set
MessagingException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |