com.sun.mail.pop3
Class POP3Folder

java.lang.Object
  |
  +--javax.mail.Folder
        |
        +--com.sun.mail.pop3.POP3Folder

public class POP3Folder
extends Folder

A POP3 Folder (can only be "INBOX"). See the com.sun.mail.pop3 package documentation for further information on the POP3 protocol provider.


Fields inherited from class javax.mail.Folder
HOLDS_FOLDERS, HOLDS_MESSAGES, READ_ONLY, READ_WRITE
 
Method Summary
 void appendMessages(Message[] msgs)
          Always throws MethodNotSupportedException because the POP3 protocol doesn't support appending messages.
 void close(boolean expunge)
           
 boolean create(int type)
          Always returns false; the POP3 protocol doesn't support creating folders.
 boolean delete(boolean recurse)
          Always throws MethodNotSupportedException because the POP3 protocol doesn't allow the INBOX to be deleted.
 boolean exists()
          Always true for the folder "INBOX", always false for any other name.
 Message[] expunge()
          Always throws MethodNotSupportedException because the POP3 protocol doesn't support expunging messages without closing the folder; call the close method with the expunge argument set to true instead.
 void fetch(Message[] msgs, FetchProfile fp)
          Prefetch information about POP3 messages.
 Folder getFolder(java.lang.String name)
          Always throws MessagingException because no POP3 folders can contain subfolders.
 java.lang.String getFullName()
           
 Message getMessage(int msgno)
           
 int getMessageCount()
          Will not change while the folder is open because the POP3 protocol doesn't support notification of new messages arriving in open folders.
 java.lang.String getName()
           
 Folder getParent()
           
 Flags getPermanentFlags()
          Always returns an empty Flags object because the POP3 protocol doesn't support any permanent flags.
 char getSeparator()
          Always returns a NUL character because POP3 doesn't support a hierarchy.
 int getType()
          Always returns Folder.HOLDS_MESSAGES.
 java.lang.String getUID(Message msg)
          Return the unique ID string for this message, or null if not available.
 boolean hasNewMessages()
          Always returns false; the POP3 protocol provides no way to determine when a new message arrives.
 boolean isOpen()
           
 Folder[] list(java.lang.String pattern)
          Always throws MessagingException because no POP3 folders can contain subfolders.
 void open(int mode)
          Throws FolderNotFoundException unless this folder is named "INBOX".
 boolean renameTo(Folder f)
          Always throws MethodNotSupportedException because the POP3 protocol doesn't support multiple folders.
 
Methods inherited from class javax.mail.Folder
addConnectionListener, addFolderListener, addMessageChangedListener, addMessageCountListener, copyMessages, getMessages, getMessages, getMessages, getMode, getNewMessageCount, getStore, getUnreadMessageCount, getURLName, isSubscribed, list, listSubscribed, listSubscribed, removeConnectionListener, removeFolderListener, removeMessageChangedListener, removeMessageCountListener, search, search, setFlags, setFlags, setFlags, setSubscribed, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getName

public java.lang.String getName()
Overrides:
getName in class Folder

getFullName

public java.lang.String getFullName()
Overrides:
getFullName in class Folder

getParent

public Folder getParent()
Overrides:
getParent in class Folder

exists

public boolean exists()
Always true for the folder "INBOX", always false for any other name.
Overrides:
exists in class Folder
Returns:
true for INBOX, false otherwise

list

public Folder[] list(java.lang.String pattern)
              throws MessagingException
Always throws MessagingException because no POP3 folders can contain subfolders.
Overrides:
list in class Folder
Throws:
MessagingException - always

getSeparator

public char getSeparator()
Always returns a NUL character because POP3 doesn't support a hierarchy.
Overrides:
getSeparator in class Folder
Returns:
NUL

getType

public int getType()
Always returns Folder.HOLDS_MESSAGES.
Overrides:
getType in class Folder
Returns:
Folder.HOLDS_MESSAGES

create

public boolean create(int type)
               throws MessagingException
Always returns false; the POP3 protocol doesn't support creating folders.
Overrides:
create in class Folder
Returns:
false

hasNewMessages

public boolean hasNewMessages()
                       throws MessagingException
Always returns false; the POP3 protocol provides no way to determine when a new message arrives.
Overrides:
hasNewMessages in class Folder
Returns:
false

getFolder

public Folder getFolder(java.lang.String name)
                 throws MessagingException
Always throws MessagingException because no POP3 folders can contain subfolders.
Overrides:
getFolder in class Folder
Throws:
MessagingException - always

delete

public boolean delete(boolean recurse)
               throws MessagingException
Always throws MethodNotSupportedException because the POP3 protocol doesn't allow the INBOX to be deleted.
Overrides:
delete in class Folder
Throws:
MethodNotSupportedException - always

renameTo

public boolean renameTo(Folder f)
                 throws MessagingException
Always throws MethodNotSupportedException because the POP3 protocol doesn't support multiple folders.
Overrides:
renameTo in class Folder
Throws:
MethodNotSupportedException - always

open

public void open(int mode)
          throws MessagingException
Throws FolderNotFoundException unless this folder is named "INBOX".
Overrides:
open in class Folder
Throws:
FolderNotFoundException - if not INBOX
AuthenticationException - authentication failures
MessagingException - other open failures

close

public void close(boolean expunge)
           throws MessagingException
Overrides:
close in class Folder

isOpen

public boolean isOpen()
Overrides:
isOpen in class Folder

getPermanentFlags

public Flags getPermanentFlags()
Always returns an empty Flags object because the POP3 protocol doesn't support any permanent flags.
Overrides:
getPermanentFlags in class Folder
Returns:
empty Flags object

getMessageCount

public int getMessageCount()
                    throws MessagingException
Will not change while the folder is open because the POP3 protocol doesn't support notification of new messages arriving in open folders.
Overrides:
getMessageCount in class Folder

getMessage

public Message getMessage(int msgno)
                   throws MessagingException
Overrides:
getMessage in class Folder

appendMessages

public void appendMessages(Message[] msgs)
                    throws MessagingException
Always throws MethodNotSupportedException because the POP3 protocol doesn't support appending messages.
Overrides:
appendMessages in class Folder
Throws:
MethodNotSupportedException - always

expunge

public Message[] expunge()
                  throws MessagingException
Always throws MethodNotSupportedException because the POP3 protocol doesn't support expunging messages without closing the folder; call the close method with the expunge argument set to true instead.
Overrides:
expunge in class Folder
Throws:
MethodNotSupportedException - always

fetch

public void fetch(Message[] msgs,
                  FetchProfile fp)
           throws MessagingException
Prefetch information about POP3 messages. If the FetchProfile contains UIDFolder.FetchProfileItem.UID, POP3 UIDs for all messages in the folder are fetched using the POP3 UIDL command. If the FetchProfile contains FetchProfile.Item.ENVELOPE, the headers and size of all messages are fetched using the POP3 TOP and LIST commands.
Overrides:
fetch in class Folder

getUID

public java.lang.String getUID(Message msg)
                        throws MessagingException
Return the unique ID string for this message, or null if not available. Uses the POP3 UIDL command.
Returns:
unique ID string
Throws:
MessagingException -