com.sun.mail.mbox
Class MboxStore

java.lang.Object
  extended by javax.mail.Service
      extended by javax.mail.Store
          extended by com.sun.mail.mbox.MboxStore

public class MboxStore
extends javax.mail.Store


Field Summary
 
Fields inherited from class javax.mail.Service
debug, session, url
 
Constructor Summary
MboxStore(javax.mail.Session session, javax.mail.URLName url)
           
 
Method Summary
 javax.mail.Folder getDefaultFolder()
          Returns a Folder object that represents the 'root' of the default namespace presented to the user by the Store.
 javax.mail.Folder getFolder(java.lang.String name)
          Return the Folder object corresponding to the given name.
 javax.mail.Folder getFolder(javax.mail.URLName url)
          Return a closed Folder object, corresponding to the given URLName.
protected  boolean protocolConnect(java.lang.String host, int port, java.lang.String user, java.lang.String passwd)
          since we do not have any authentication to do and we do not want a dialog put up asking the user for a password we always succeed in connecting.
protected  void setURLName(javax.mail.URLName url)
          Set the URLName representing this service.
 
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, finalize, getURLName, isConnected, notifyConnectionListeners, queueEvent, removeConnectionListener, setConnected, toString
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MboxStore

public MboxStore(javax.mail.Session session,
                 javax.mail.URLName url)
Method Detail

protocolConnect

protected boolean protocolConnect(java.lang.String host,
                                  int port,
                                  java.lang.String user,
                                  java.lang.String passwd)
                           throws javax.mail.MessagingException
since we do not have any authentication to do and we do not want a dialog put up asking the user for a password we always succeed in connecting.

Overrides:
protocolConnect in class javax.mail.Service
Parameters:
host - the name of the host to connect to
port - the port to use (-1 means use default port)
user - the name of the user to login as
passwd - the user's password
Returns:
true if connection successful, false if authentication failed
Throws:
javax.mail.MessagingException - for non-authentication failures

setURLName

protected void setURLName(javax.mail.URLName url)
Description copied from class: javax.mail.Service
Set the URLName representing this service. Normally used to update the url field after a service has successfully connected.

Subclasses should only override this method if their URL does not follow the standard format. In particular, subclasses should override this method if their URL does not require all the possible fields supported by URLName; a new URLName should be constructed with any unneeded fields removed.

The implementation in the Service class simply sets the url field.

Overrides:
setURLName in class javax.mail.Service
See Also:
URLName

getDefaultFolder

public javax.mail.Folder getDefaultFolder()
                                   throws javax.mail.MessagingException
Description copied from class: javax.mail.Store
Returns a Folder object that represents the 'root' of the default namespace presented to the user by the Store.

Specified by:
getDefaultFolder in class javax.mail.Store
Returns:
the root Folder
Throws:
javax.mail.MessagingException

getFolder

public javax.mail.Folder getFolder(java.lang.String name)
                            throws javax.mail.MessagingException
Description copied from class: javax.mail.Store
Return the Folder object corresponding to the given name. Note that a Folder object is returned even if the named folder does not physically exist on the Store. The exists() method on the folder object indicates whether this folder really exists.

Folder objects are not cached by the Store, so invoking this method on the same name multiple times will return that many distinct Folder objects.

Specified by:
getFolder in class javax.mail.Store
Parameters:
name - The name of the Folder. In some Stores, name can be an absolute path if it starts with the hierarchy delimiter. Else it is interpreted relative to the 'root' of this namespace.
Returns:
Folder object
Throws:
javax.mail.MessagingException
See Also:
Folder.exists(), Folder.create(int)

getFolder

public javax.mail.Folder getFolder(javax.mail.URLName url)
                            throws javax.mail.MessagingException
Description copied from class: javax.mail.Store
Return a closed Folder object, corresponding to the given URLName. The store specified in the given URLName should refer to this Store object.

Implementations of this method may obtain the name of the actual folder using the getFile() method on URLName, and use that name to create the folder.

Specified by:
getFolder in class javax.mail.Store
Parameters:
url - URLName that denotes a folder
Returns:
Folder object
Throws:
javax.mail.MessagingException
See Also:
URLName