Package gnu.mail.providers.mbox
Class MboxStore
- java.lang.Object
-
- javax.mail.Service
-
- javax.mail.Store
-
- gnu.mail.providers.mbox.MboxStore
-
- All Implemented Interfaces:
gnu.mail.treeutil.StatusSource
public final class MboxStore extends Store implements gnu.mail.treeutil.StatusSource
The storage class implementing the Mbox mailbox file format.- Author:
- Chris Burdess
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addStatusListener(gnu.mail.treeutil.StatusListener l)
Adds a status listener to this store.Folder
getDefaultFolder()
Returns the default folder.Folder
getFolder(java.lang.String name)
Returns the folder with the specified filename.Folder
getFolder(URLName urlname)
Returns the folder specified by the filename of the URLName.protected void
processStatusEvent(gnu.mail.treeutil.StatusEvent event)
Processes a status event.protected boolean
protocolConnect(java.lang.String host, int port, java.lang.String username, java.lang.String password)
There isn't a protocol to implement, so this method just returns.void
removeStatusListener(gnu.mail.treeutil.StatusListener l)
Removes a status listener from this store.protected void
setURLName(URLName url)
Sets the correct form of the URLName.-
Methods inherited from class javax.mail.Store
addFolderListener, addStoreListener, getPersonalNamespaces, getSharedNamespaces, getUserNamespaces, notifyFolderListeners, notifyFolderRenamedListeners, notifyStoreListeners, removeFolderListener, removeStoreListener
-
Methods inherited from class javax.mail.Service
addConnectionListener, close, connect, connect, connect, connect, getURLName, isConnected, notifyConnectionListeners, queueEvent, removeConnectionListener, setConnected, toString
-
-
-
-
Method Detail
-
protocolConnect
protected boolean protocolConnect(java.lang.String host, int port, java.lang.String username, java.lang.String password) throws MessagingException
There isn't a protocol to implement, so this method just returns.- Overrides:
protocolConnect
in classService
- Parameters:
host
- the name of the host to connect toport
- the port to use (-1 for the default port)username
- the usernamepassword
- the password- Returns:
- true on success, false if authentication failed
- Throws:
AuthenticationFailedException
- on authentication failureMessagingException
- for non-authentication failures
-
setURLName
protected void setURLName(URLName url)
Sets the correct form of the URLName.- Overrides:
setURLName
in classService
-
getDefaultFolder
public Folder getDefaultFolder() throws MessagingException
Returns the default folder.- Specified by:
getDefaultFolder
in classStore
- Throws:
MessagingException
-
getFolder
public Folder getFolder(java.lang.String name) throws MessagingException
Returns the folder with the specified filename.- Specified by:
getFolder
in classStore
- Parameters:
name
- the folder name- Throws:
MessagingException
-
getFolder
public Folder getFolder(URLName urlname) throws MessagingException
Returns the folder specified by the filename of the URLName.- Specified by:
getFolder
in classStore
- Parameters:
urlname
- a URLName denoting a folder- Throws:
MessagingException
-
addStatusListener
public void addStatusListener(gnu.mail.treeutil.StatusListener l)
Adds a status listener to this store. The listener will be informed of state changes during potentially lengthy procedures(opening and closing mboxes).- Specified by:
addStatusListener
in interfacegnu.mail.treeutil.StatusSource
- Parameters:
l
- the status listener- See Also:
removeStatusListener(gnu.mail.treeutil.StatusListener)
-
removeStatusListener
public void removeStatusListener(gnu.mail.treeutil.StatusListener l)
Removes a status listener from this store.- Specified by:
removeStatusListener
in interfacegnu.mail.treeutil.StatusSource
- Parameters:
l
- the status listener- See Also:
addStatusListener(gnu.mail.treeutil.StatusListener)
-
processStatusEvent
protected void processStatusEvent(gnu.mail.treeutil.StatusEvent event)
Processes a status event. This dispatches the event to all the registered listeners.- Parameters:
event
- the status event
-
-