⇒ Index (Frames) |  ⇒ Index (No Frames) |  ⇒ Package |  ⇒ Package Tree |  ⇒ Full Tree 
gnu.mail.providers.imap

Class IMAPStore

java.lang.Object
|
+--javax.mail.Service
   |
   +--javax.mail.Store
      |
      +--gnu.mail.providers.imap.IMAPStore


public class IMAPStore
extends Store

The storage class implementing the IMAP4rev1 mail protocol.
Author:

Field Summary

IMAPConnection

connection

The connection to the IMAP server.

IMAPFolder

root

Folder representing the root namespace of the IMAP connection.

IMAPFolder

selected

The currently selected folder.

Constructor Summary

IMAPStore(Session session, URLName url)

Constructor.

Method Summary

synchronized void

close()

Closes the connection.

IMAPConnection

getConnection()

Returns the IMAP connection used by this store.

Folder

getDefaultFolder()

Returns the root folder.

Folder

getFolder(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.

boolean

isSelected(IMAPFolder folder)

Indicates whether the specified folder is selected.

void

processAlerts()

Process any alerts supplied by the server.

boolean

protocolConnect(String host, int port, String username, String password)

Connects to the IMAP server and authenticates with the specified parameters.

void

setSelected(IMAPFolder folder)

Sets the selected folder.

Field Details

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 Details

IMAPStore

public IMAPStore(Session session, URLName url)

Constructor.

Parameters:
session
url

Method Details

close

public synchronized 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.

Parameters:
name

getFolder

public Folder getFolder(URLName urlname)

Returns the folder whose name is the file part of the specified URLName.

Parameters:
urlname

isSelected

protected boolean isSelected(IMAPFolder folder)

Indicates whether the specified folder is selected.

Parameters:
folder

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.

Parameters:
host
port
username
password

setSelected

protected void setSelected(IMAPFolder folder)

Sets the selected folder.

Parameters:
folder