|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.mail.Folder | +--com.sun.mail.pop3.POP3Folder
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, mode, READ_ONLY, READ_WRITE, store |
Method Summary | |
void |
appendMessages(Message[] msgs)
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 |
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. |
protected void |
finalize()
Close the folder when we're finalized. |
Folder |
getFolder(java.lang.String name)
Always throws MessagingException because no POP3 folders
can contain subfolders. |
java.lang.String |
getFullName()
Returns the full name of this Folder. |
Message |
getMessage(int msgno)
Get the Message object corresponding to the given message number. |
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()
Returns the name of this Folder. |
Folder |
getParent()
Returns the parent folder of this folder. |
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()
Indicates whether this Folder is in the 'open' state. |
Folder[] |
list(java.lang.String pattern)
Always throws MessagingException because no POP3 folders
can contain subfolders. |
protected void |
notifyMessageChangedListeners(int type,
Message m)
Notify all MessageChangedListeners. |
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 java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
public java.lang.String getName()
Folder
This method can be invoked on a closed Folder.
getName
in class Folder
javax.mail.Folder
public java.lang.String getFullName()
Folder
This method can be invoked on a closed Folder.
getFullName
in class Folder
javax.mail.Folder
public Folder getParent()
Folder
Note that since Folder objects are not cached, invoking this method returns a new distinct Folder object.
getParent
in class Folder
javax.mail.Folder
public boolean exists()
exists
in class Folder
public Folder[] list(java.lang.String pattern) throws MessagingException
MessagingException
because no POP3 folders
can contain subfolders.list
in class Folder
MessagingException
- alwayspublic char getSeparator()
getSeparator
in class Folder
public int getType()
getType
in class Folder
public boolean create(int type) throws MessagingException
false
; the POP3 protocol doesn't
support creating folders.create
in class Folder
public boolean hasNewMessages() throws MessagingException
false
; the POP3 protocol provides
no way to determine when a new message arrives.hasNewMessages
in class Folder
public Folder getFolder(java.lang.String name) throws MessagingException
MessagingException
because no POP3 folders
can contain subfolders.getFolder
in class Folder
MessagingException
- alwayspublic boolean delete(boolean recurse) throws MessagingException
MethodNotSupportedException
because the POP3 protocol doesn't allow the INBOX to
be deleted.delete
in class Folder
MethodNotSupportedException
- alwayspublic boolean renameTo(Folder f) throws MessagingException
MethodNotSupportedException
because the POP3 protocol doesn't support multiple folders.renameTo
in class Folder
MethodNotSupportedException
- alwayspublic void open(int mode) throws MessagingException
FolderNotFoundException
unless this
folder is named "INBOX".open
in class Folder
FolderNotFoundException
- if not INBOXAuthenticationException
- authentication failuresMessagingException
- other open failurespublic void close(boolean expunge) throws MessagingException
Folder
A CLOSED ConnectionEvent is delivered to any ConnectionListeners registered on this Folder. Note that the folder is closed even if this method terminates abnormally by throwing a MessagingException.
close
in class Folder
javax.mail.Folder
expunge
- expunges all deleted messages if this flag is trueIllegalStateException
- if this folder is not openedMessagingException
- ConnectionEvent
public boolean isOpen()
Folder
isOpen
in class Folder
javax.mail.Folder
public Flags getPermanentFlags()
Flags
object because
the POP3 protocol doesn't support any permanent flags.getPermanentFlags
in class Folder
public int getMessageCount() throws MessagingException
getMessageCount
in class Folder
javax.mail.Folder
FolderNotFoundException
- if this folder does
not exist.MessagingException
- public Message getMessage(int msgno) throws MessagingException
Folder
Message objects are light-weight references to the actual message that get filled up on demand. Hence Folder implementations are expected to provide light-weight Message objects.
Unlike Folder objects, repeated calls to getMessage with the same message number will return the same Message object, as long as no messages in this folder have been expunged.
Since message numbers can change within a session if the folder is expunged , clients are advised not to use message numbers as references to messages. Use Message objects instead.
getMessage
in class Folder
javax.mail.Folder
msgnum
- the message numberFolderNotFoundException
- if this folder does
not exist.IllegalStateException
- if this folder is not openedIndexOutOfBoundsException
- if the message number
is out of range.MessagingException
- Folder.getMessageCount()
,
Folder.fetch(javax.mail.Message[], javax.mail.FetchProfile)
protected POP3Message createMessage(Folder f, int msgno) throws MessagingException
public void appendMessages(Message[] msgs) throws MessagingException
MethodNotSupportedException
because the POP3 protocol doesn't support appending messages.appendMessages
in class Folder
MethodNotSupportedException
- alwayspublic Message[] expunge() throws MessagingException
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.expunge
in class Folder
MethodNotSupportedException
- alwayspublic void fetch(Message[] msgs, FetchProfile fp) throws MessagingException
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.fetch
in class Folder
javax.mail.Folder
msgs
- fetch items for these messagesfp
- the FetchProfileIllegalStateException
- if this folder is not openedMessagingException.
- public java.lang.String getUID(Message msg) throws MessagingException
MessagingException
- protected void finalize() throws java.lang.Throwable
finalize
in class Folder
protected void notifyMessageChangedListeners(int type, Message m)
Folder
The provided implementation queues the event into an internal event queue. An event dispatcher thread dequeues events from the queue and dispatches them to registered MessageChangedListeners. Note that the event dispatching occurs in a separate thread, thus avoiding potential deadlock problems.
notifyMessageChangedListeners
in class Folder
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |