This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.


com.sun.mail.pop3
class POP3Folder

javax.mail.Folder extended by 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.


Field Summary
 
Fields inherited from class javax.mail.Folder
HOLDS_FOLDERS, HOLDS_MESSAGES, mode, READ_ONLY, READ_WRITE, store
 
Method Summary
 void

          Always throws MethodNotSupportedException because the POP3 protocol doesn't support appending messages.
 void
close(boolean expunge)

          Close this Folder.
 boolean
create(int type)

          Always returns false; the POP3 protocol doesn't support creating folders.
protected POP3Message
createMessage(Folder f, int msgno)

          
 boolean
delete(boolean recurse)

          Always throws MethodNotSupportedException because the POP3 protocol doesn't allow the INBOX to be deleted.
 boolean

          Always true for the folder "INBOX", always false for any other name.
 Message[]

          Always throws MethodNotSupportedException because the POP3 protocol doesn't support expunging messages without closing the folder; call the com.sun.mail.pop3.POP3Folder.close method with the expunge argument set to true instead.
 void
fetch(Message[] msgs, FetchProfile fp)

          Prefetch information about POP3 messages.
protected void

          Close the folder when we're finalized.
 Folder

          Always throws MessagingException because no POP3 folders can contain subfolders.
 String

          Returns the full name of this Folder.
 Message
getMessage(int msgno)

          Get the Message object corresponding to the given message number.
 int

          Will not change while the folder is open because the POP3 protocol doesn't support notification of new messages arriving in open folders.
 String

          Returns the name of this Folder.
 Folder

          Returns the parent folder of this folder.
 Flags

          Always returns an empty Flags object because the POP3 protocol doesn't support any permanent flags.
 char

          Always returns a NUL character because POP3 doesn't support a hierarchy.
 int

          Return the size of this folder, as was returned by the POP3 STAT command when this folder was opened.
 int[]

          Return the sizes of all messages in this folder, as returned by the POP3 LIST command.
 int

          Always returns Folder.HOLDS_MESSAGES.
 String

          Return the unique ID string for this message, or null if not available.
 boolean

          Always returns false; the POP3 protocol provides no way to determine when a new message arrives.
 boolean

          Indicates whether this Folder is in the 'open' state.
 Folder[]
list(String pattern)

          Always throws MessagingException because no POP3 folders can contain subfolders.
 InputStream

          Return the raw results of the POP3 LIST command with no arguments.
protected void

          Notify all MessageChangedListeners.
 void
open(int mode)

          Throws FolderNotFoundException unless this folder is named "INBOX".
 boolean

          Always throws MethodNotSupportedException because the POP3 protocol doesn't support multiple folders.
 
Methods inherited from class javax.mail.Folder
addConnectionListener, addFolderListener, addMessageChangedListener, addMessageCountListener, appendMessages, close, copyMessages, create, delete, exists, expunge, fetch, finalize, getDeletedMessageCount, getFolder, getFullName, getMessage, getMessageCount, getMessages, getMessages, getMessages, getMode, getName, getNewMessageCount, getParent, getPermanentFlags, getSeparator, getStore, getType, getUnreadMessageCount, getURLName, hasNewMessages, isOpen, isSubscribed, list, list, listSubscribed, listSubscribed, notifyConnectionListeners, notifyFolderListeners, notifyFolderRenamedListeners, notifyMessageAddedListeners, notifyMessageChangedListeners, notifyMessageRemovedListeners, open, removeConnectionListener, removeFolderListener, removeMessageChangedListener, removeMessageCountListener, renameTo, search, search, setFlags, setFlags, setFlags, setSubscribed, toString
 

Method Detail

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
Parameters:
msgs
Throws:
MessagingException

close

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

create

public boolean create(int type)
               throws MessagingException
Always returns false; the POP3 protocol doesn't support creating folders.

Overrides:
create in class Folder
Parameters:
type
Returns:
false
Throws:
MessagingException

createMessage

protected POP3Message createMessage(Folder f,
                                    int msgno)
                             throws MessagingException
Parameters:
f
msgno
Throws:
MessagingException

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
Parameters:
recurse
Throws:
MessagingException

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

expunge

public Message[] expunge()
                  throws MessagingException
Always throws MethodNotSupportedException because the POP3 protocol doesn't support expunging messages without closing the folder; call the {@link #close close} method with the expunge argument set to true instead.

Overrides:
expunge in class Folder
Throws:
MessagingException

fetch

public synchronized 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
Parameters:
msgs
fp
Throws:
MessagingException

finalize

protected void finalize()
                 throws Throwable
Close the folder when we're finalized.

Overrides:
finalize in class Folder
Throws:
Throwable

getFolder

public Folder getFolder(String name)
                 throws MessagingException
Always throws MessagingException because no POP3 folders can contain subfolders.

Overrides:
getFolder in class Folder
Parameters:
name
Throws:
MessagingException - always

getFullName

public String getFullName()
Overrides:
getFullName in class Folder

getMessage

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

getMessageCount

public synchronized 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
Throws:
MessagingException

getName

public String getName()
Overrides:
getName in class Folder

getParent

public Folder getParent()
Overrides:
getParent 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

getSeparator

public char getSeparator()
Always returns a NUL character because POP3 doesn't support a hierarchy.

Overrides:
getSeparator in class Folder
Returns:
NUL

getSize

public synchronized int getSize()
                         throws MessagingException
Return the size of this folder, as was returned by the POP3 STAT command when this folder was opened.

Returns:
folder size
Throws:
MessagingException

getSizes

public synchronized int[] getSizes()
                            throws MessagingException
Return the sizes of all messages in this folder, as returned by the POP3 LIST command. Each entry in the array corresponds to a message; entry i corresponds to message number i+1.

Returns:
array of message sizes
Throws:
MessagingException

getType

public int getType()
Always returns Folder.HOLDS_MESSAGES.

Overrides:
getType in class Folder
Returns:
Folder.HOLDS_MESSAGES

getUID

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

Parameters:
msg
Returns:
unique ID string
Throws:
MessagingException

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
Throws:
MessagingException

isOpen

public boolean isOpen()
Overrides:
isOpen in class Folder

list

public Folder[] list(String pattern)
              throws MessagingException
Always throws MessagingException because no POP3 folders can contain subfolders.

Overrides:
list in class Folder
Parameters:
pattern
Throws:
MessagingException - always

listCommand

public synchronized InputStream listCommand()
                                     throws MessagingException,
                                            IOException
Return the raw results of the POP3 LIST command with no arguments.

Returns:
InputStream containing results
Throws:
MessagingException
IOException

notifyMessageChangedListeners

protected void notifyMessageChangedListeners(int type,
                                             Message m)
Overrides:
notifyMessageChangedListeners in class Folder
Parameters:
type
m

open

public synchronized void open(int mode)
                       throws MessagingException
Throws FolderNotFoundException unless this folder is named "INBOX".

Overrides:
open in class Folder
Parameters:
mode
Throws:
MessagingException - other open failures

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
Parameters:
f
Throws:
MessagingException


This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.
This page displays the Jadeite version of the documention. The official Sun™ documentation can be found here at http://java.sun.com/products/javamail/javadocs/index.html.