org.apache.geronimo.javamail.store.pop3
Class POP3RootFolder

java.lang.Object
  extended by javax.mail.Folder
      extended by org.apache.geronimo.javamail.store.pop3.POP3Folder
          extended by org.apache.geronimo.javamail.store.pop3.POP3RootFolder

public class POP3RootFolder
extends POP3Folder

An POP3 folder instance for the root of POP3 folder tree. This has some of the folder operations disabled.


Field Summary
protected  Folder inbox
           
 
Fields inherited from class org.apache.geronimo.javamail.store.pop3.POP3Folder
exists, folderType, fullName, isFolderOpen, mode, msgCount
 
Fields inherited from class javax.mail.Folder
HOLDS_FOLDERS, HOLDS_MESSAGES, READ_ONLY, READ_WRITE, store
 
Constructor Summary
POP3RootFolder(POP3Store store)
          Create a default POP3RootFolder attached to a specific Store instance.
 
Method Summary
 Folder getFolder(String name)
          Get a folder of a given name from the root folder.
protected  Folder getInbox()
          Retrieve the INBOX folder from the root.
 Folder getParent()
          Get the parent.
 char getSeparator()
          We have a separator because the root folder is "special".
 boolean isOpen()
          Override for the isOpen method.
 Folder[] list(String pattern)
          Retrieve a list of folders that match a pattern.
 void open(boolean expunge)
           
 void open(int mode)
           
 
Methods inherited from class org.apache.geronimo.javamail.store.pop3.POP3Folder
appendMessages, cleanupFolder, close, create, delete, exists, expunge, expungeDeletedMessages, fetch, getConnection, getFullName, getMessage, getMessageCount, getMode, getName, getPermanentFlags, getType, getUID, hasNewMessages, notifyMessageChangedListeners, releaseConnection, renameTo
 
Methods inherited from class javax.mail.Folder
addConnectionListener, addFolderListener, addMessageChangedListener, addMessageCountListener, copyMessages, finalize, getDeletedMessageCount, getMessages, getMessages, getMessages, getNewMessageCount, getStore, getUnreadMessageCount, getURLName, isSubscribed, list, listSubscribed, listSubscribed, notifyConnectionListeners, notifyFolderListeners, notifyFolderRenamedListeners, notifyMessageAddedListeners, notifyMessageRemovedListeners, removeConnectionListener, removeFolderListener, removeMessageChangedListener, removeMessageCountListener, search, search, setFlags, setFlags, setFlags, setSubscribed, toString
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

inbox

protected Folder inbox
Constructor Detail

POP3RootFolder

public POP3RootFolder(POP3Store store)
Create a default POP3RootFolder attached to a specific Store instance.

Parameters:
store - The Store instance this is the root for.
Method Detail

getParent

public Folder getParent()
Get the parent. This is the root folder, which never has a parent.

Overrides:
getParent in class POP3Folder
Returns:
Always returns null.

getSeparator

public char getSeparator()
                  throws MessagingException
We have a separator because the root folder is "special".

Overrides:
getSeparator in class POP3Folder
Throws:
MessagingException

list

public Folder[] list(String pattern)
              throws MessagingException
Retrieve a list of folders that match a pattern.

Overrides:
list in class POP3Folder
Parameters:
pattern - The match pattern.
Returns:
An array of matching folders.
Throws:
MessagingException

getFolder

public Folder getFolder(String name)
                 throws MessagingException
Get a folder of a given name from the root folder. The Sun implementation seems somewhat inconsistent here. The docs for Store claim that only INBOX is supported, but it will return a Folder instance for any name. On the other hand, the root folder raises an exception for anything but the INBOX.

Overrides:
getFolder in class POP3Folder
Parameters:
name - The folder name (which must be "INBOX".
Returns:
The inbox folder instance.
Throws:
MessagingException

isOpen

public boolean isOpen()
Override for the isOpen method. The root folder can never be opened.

Overrides:
isOpen in class POP3Folder
Returns:
always returns false.

open

public void open(int mode)
          throws MessagingException
Overrides:
open in class POP3Folder
Throws:
MessagingException
See Also:
Folder.open(int)

open

public void open(boolean expunge)
          throws MessagingException
Throws:
MessagingException

getInbox

protected Folder getInbox()
                   throws MessagingException
Retrieve the INBOX folder from the root.

Returns:
The Folder instance for the inbox.
Throws:
MessagingException


Copyright © 2003-2009 The Apache Software Foundation. All Rights Reserved.