gnu.mail.providers.pop3

Class POP3Folder


public final class POP3Folder
extends Folder

The folder class implementing the POP3 mail protocol.

Field Summary

Fields inherited from class javax.mail.Folder

HOLDS_FOLDERS, HOLDS_MESSAGES, READ_ONLY, READ_WRITE, mode, store

Constructor Summary

POP3Folder(Store store, int type)
Constructor.

Method Summary

void
appendMessages(Message[] messages)
You can't append messages to a POP3 folder.
void
close(boolean expunge)
Closes this folder.
boolean
create(int i)
POP3 folders can't be created, deleted, or renamed.
boolean
delete(boolean flag)
POP3 folders can't be created, deleted, or renamed.
boolean
exists()
Indicates whether this folder exists.
Message[]
expunge()
Expunges this folder.
void
fetch(Message[] messages, FetchProfile fp)
Fetches headers and/or content for the specified messages.
Folder
getFolder(String s)
POP3 folders can't contain subfolders.
String
getFullName()
Returns the full name of this folder.
Message
getMessage(int msgnum)
Returns the specified message from this folder.
int
getMessageCount()
Returns the number of messages in this folder.
String
getName()
Returns the name of this folder.
Folder
getParent()
POP3 folders can't have parents.
Flags
getPermanentFlags()
Returns the permanent flags for this folder.
char
getSeparator()
Returns the path separator charcter.
int
getType()
Returns the type of this folder.
String
getUID(Message message)
Returns the unique ID for the given message, or null if not available.
boolean
hasNewMessages()
Indicates whether this folder contains new messages.
boolean
isOpen()
Indicates whether this folder is open.
Folder[]
list()
Returns the subfolders for this folder.
Folder[]
list(String pattern)
Returns the subfolders for this folder.
void
open(int mode)
Opens this folder.
boolean
renameTo(Folder folder)
POP3 folders can't be created, deleted, or renamed.

Methods inherited from class javax.mail.Folder

addConnectionListener, addFolderListener, addMessageChangedListener, addMessageCountListener, appendMessages, close, copyMessages, create, delete, exists, expunge, fetch, getDeletedMessageCount, getFolder, getFullName, getMessage, getMessageCount, getMessages, getMessages, getMessages, getMode, getName, getNewMessageCount, getParent, getPermanentFlags, getSeparator, getStore, getType, getURLName, getUnreadMessageCount, 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

Constructor Details

POP3Folder

protected POP3Folder(Store store,
                     int type)
Constructor.

Method Details

appendMessages

public void appendMessages(Message[] messages)
            throws MessagingException
You can't append messages to a POP3 folder.


close

public void close(boolean expunge)
            throws MessagingException
Closes this folder.
Overrides:
close in interface Folder

Parameters:
expunge - if the folder is to be expunged before it is closed

Throws:
MessagingException - if a messaging error occurred


create

public boolean create(int i)
            throws MessagingException
POP3 folders can't be created, deleted, or renamed.
Overrides:
create in interface Folder


delete

public boolean delete(boolean flag)
            throws MessagingException
POP3 folders can't be created, deleted, or renamed.
Overrides:
delete in interface Folder


exists

public boolean exists()
            throws MessagingException
Indicates whether this folder exists.
Overrides:
exists in interface Folder

Throws:
MessagingException - if a messaging error occurred


expunge

public Message[] expunge()
            throws MessagingException
Expunges this folder. This deletes all the messages marked as deleted.
Overrides:
expunge in interface Folder

Throws:
MessagingException - if a messaging error occurred


fetch

public void fetch(Message[] messages,
                  FetchProfile fp)
            throws MessagingException
Fetches headers and/or content for the specified messages.

Throws:
MessagingException - ignore


getFolder

public Folder getFolder(String s)
            throws MessagingException
POP3 folders can't contain subfolders.
Overrides:
getFolder in interface Folder


getFullName

public String getFullName()
Returns the full name of this folder.
Overrides:
getFullName in interface Folder


getMessage

public Message getMessage(int msgnum)
            throws MessagingException
Returns the specified message from this folder.
Overrides:
getMessage in interface Folder

Parameters:
msgnum - the message number

Throws:
MessagingException - if a messaging error occurred


getMessageCount

public int getMessageCount()
            throws MessagingException
Returns the number of messages in this folder. This results in a STAT call to the POP3 server, so the latest count is always delivered.
Overrides:
getMessageCount in interface Folder

Throws:
MessagingException - if a messaging error occurred


getName

public String getName()
Returns the name of this folder.
Overrides:
getName in interface Folder


getParent

public Folder getParent()
            throws MessagingException
POP3 folders can't have parents.
Overrides:
getParent in interface Folder


getPermanentFlags

public Flags getPermanentFlags()
Returns the permanent flags for this folder.
Overrides:
getPermanentFlags in interface Folder


getSeparator

public char getSeparator()
            throws MessagingException
Returns the path separator charcter.
Overrides:
getSeparator in interface Folder


getType

public int getType()
            throws MessagingException
Returns the type of this folder.
Overrides:
getType in interface Folder

Throws:
MessagingException - if a messaging error occurred


getUID

public String getUID(Message message)
            throws MessagingException
Returns the unique ID for the given message, or null if not available.

Parameters:
message - the message


hasNewMessages

public boolean hasNewMessages()
            throws MessagingException
Indicates whether this folder contains new messages.
Overrides:
hasNewMessages in interface Folder

Throws:
MessagingException - if a messaging error occurred


isOpen

public boolean isOpen()
Indicates whether this folder is open.
Overrides:
isOpen in interface Folder


list

public Folder[] list()
            throws MessagingException
Returns the subfolders for this folder.
Overrides:
list in interface Folder


list

public Folder[] list(String pattern)
            throws MessagingException
Returns the subfolders for this folder.
Overrides:
list in interface Folder


open

public void open(int mode)
            throws MessagingException
Opens this folder.
Overrides:
open in interface Folder

Throws:
MessagingException - if a messaging error occurred


renameTo

public boolean renameTo(Folder folder)
            throws MessagingException
POP3 folders can't be created, deleted, or renamed.
Overrides:
renameTo in interface Folder