javax.mail
Class Store
public abstract class Store
Abstract class that represents a message store.
addConnectionListener , close , connect , connect , connect , finalize , getURLName , isConnected , notifyConnectionListeners , protocolConnect , queueEvent , removeConnectionListener , setConnected , setURLName , toString |
Store
protected Store(Session session,
URLName name)
Constructor specifying session and url of this store.
Subclasses MUST provide a constructor with this signature.
session
- the session associated with this storename
- the URL of the store
addFolderListener
public void addFolderListener(FolderListener listener)
addStoreListener
public void addStoreListener(StoreListener listener)
getDefaultFolder
public abstract Folder getDefaultFolder()
throws MessagingException
Retutn a Folder object that represents the root of the namespace for the current user.
Note that in some store configurations (such as IMAP4) then the root folder may
not be the INBOX folder.
getFolder
public abstract Folder getFolder(String name)
throws MessagingException
Return the Folder corresponding to the given name.
The folder may not physically exist; the
Folder.exists()
method can be used
to determine if it is real.
name
- the name of the Folder to return
getFolder
public abstract Folder getFolder(URLName name)
throws MessagingException
Return the folder identified by the URLName; the URLName must refer to this Store.
Implementations may use the
URLName.getFile()
method to determined the folder name.
name
- the folder to return
getPersonalNamespaces
public Folder[] getPersonalNamespaces()
throws MessagingException
Return the root folders of the personal namespace belonging to the current user.
The default implementation simply returns an array containing the folder returned by
getDefaultFolder()
.
- the root folders of the user's peronal namespaces
getSharedNamespaces
public Folder[] getSharedNamespaces()
throws MessagingException
Return the root folders of namespaces that are intended to be shared between users.
The default implementation simply returns an empty array.
- the root folders of all shared namespaces
getUserNamespaces
public Folder[] getUserNamespaces(String user)
throws MessagingException
Return the root folders of the personal namespaces belonging to the supplied user.
The default implementation simply returns an empty array.
user
- the user whose namespaces should be returned
- the root folders of the given user's peronal namespaces
notifyFolderListeners
protected void notifyFolderListeners(int type,
Folder folder)
notifyFolderRenamedListeners
protected void notifyFolderRenamedListeners(Folder oldFolder,
Folder newFolder)
notifyStoreListeners
protected void notifyStoreListeners(int type,
String message)
removeFolderListener
public void removeFolderListener(FolderListener listener)
removeStoreListener
public void removeStoreListener(StoreListener listener)