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

java.lang.Object
  extended byjavax.mail.Folder
      extended byorg.apache.geronimo.javamail.store.pop3.POP3Folder

public class POP3Folder
extends Folder

The POP3 implementation of the javax.mail.Folder Note that only INBOX is supported in POP3

http://www.faqs.org/rfcs/rfc1939.html

Version:
$Rev: 432884 $ $Date: 2006-08-19 14:53:20 -0700 (Sat, 19 Aug 2006) $
See Also:
Folder

Field Summary
 
Fields inherited from class javax.mail.Folder
HOLDS_FOLDERS, HOLDS_MESSAGES, READ_ONLY, READ_WRITE, store
 
Constructor Summary
protected POP3Folder(Store store, Session session, POP3Connection pop3Con)
           
protected POP3Folder(Store store, URLName url)
           
 
Method Summary
 void appendMessages(Message[] msgs)
           
 void close(boolean expunge)
           
 boolean create(int type)
           
 boolean delete(boolean recurse)
           
 boolean exists()
           
 Message[] expunge()
           
 void fetch(Message[] msgs, FetchProfile fp)
           
 Folder getFolder(String name)
           
 String getFullName()
           
 Message getMessage(int msgNum)
          Checks wether the message is in cache, if not will create a new message object and return it.
 int getMessageCount()
           
 int getMode()
           
 String getName()
           
 Folder getParent()
          Never return "this" as the parent folder.
 Flags getPermanentFlags()
           
 char getSeparator()
          No sub folders, hence there is no notion of a seperator
 int getType()
           
 boolean hasNewMessages()
           
 boolean isOpen()
           
 Folder[] list(String pattern)
           
 void notifyMessageChangedListeners(int type, Message m)
           
 void open(int mode)
           
 boolean renameTo(Folder f)
           
 
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
 

Constructor Detail

POP3Folder

protected POP3Folder(Store store,
                     URLName url)

POP3Folder

protected POP3Folder(Store store,
                     Session session,
                     POP3Connection pop3Con)
Method Detail

getName

public String getName()

getFullName

public String getFullName()

getParent

public Folder getParent()
                 throws MessagingException
Never return "this" as the parent folder. Somebody not familliar with POP3 may do something like while(getParent() != null) or something simmilar which will result in an infinte loop

Throws:
MessagingException

exists

public boolean exists()
               throws MessagingException
Throws:
MessagingException

list

public Folder[] list(String pattern)
              throws MessagingException
Throws:
MessagingException

getSeparator

public char getSeparator()
                  throws MessagingException
No sub folders, hence there is no notion of a seperator

Throws:
MessagingException

getType

public int getType()
            throws MessagingException
Throws:
MessagingException

create

public boolean create(int type)
               throws MessagingException
Throws:
MessagingException

hasNewMessages

public boolean hasNewMessages()
                       throws MessagingException
Throws:
MessagingException

getFolder

public Folder getFolder(String name)
                 throws MessagingException
Throws:
MessagingException

delete

public boolean delete(boolean recurse)
               throws MessagingException
Throws:
MessagingException

renameTo

public boolean renameTo(Folder f)
                 throws MessagingException
Throws:
MessagingException

open

public void open(int mode)
          throws MessagingException
Throws:
MessagingException
See Also:
Folder.open(int)

close

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

isOpen

public boolean isOpen()

getPermanentFlags

public Flags getPermanentFlags()

getMessageCount

public int getMessageCount()
                    throws MessagingException
Throws:
MessagingException

getMessage

public Message getMessage(int msgNum)
                   throws MessagingException
Checks wether the message is in cache, if not will create a new message object and return it.

Throws:
MessagingException
See Also:
Folder.getMessage(int)

appendMessages

public void appendMessages(Message[] msgs)
                    throws MessagingException
Throws:
MessagingException

expunge

public Message[] expunge()
                  throws MessagingException
Throws:
MessagingException

getMode

public int getMode()
            throws IllegalStateException
Throws:
IllegalStateException

fetch

public void fetch(Message[] msgs,
                  FetchProfile fp)
           throws MessagingException
Throws:
MessagingException
See Also:
The JavaMail API recommends that this method be overrident to provide a meaningfull implementation.

notifyMessageChangedListeners

public void notifyMessageChangedListeners(int type,
                                          Message m)
See Also:
this method is protected and cannot be used outside of Folder, therefore had to explicitly expose it via a method in POP3Folder, so that POP3Message has access to it Bad design on the part of the Java Mail API.


Copyright © 2006 Apache Software Foundation. All Rights Reserved.