|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
java.lang.Objectjavax.mail.Folder
com.sun.mail.pop3.POP3Folder
public class POP3Folder
A POP3 Folder (can only be "INBOX"). See the com.sun.mail.pop3 package documentation for further information on the POP3 protocol provider.
| 字段摘要 |
|---|
| 从类 javax.mail.Folder 继承的字段 |
|---|
HOLDS_FOLDERS, HOLDS_MESSAGES, mode, READ_ONLY, READ_WRITE, store |
| 方法摘要 | |
|---|---|
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(String name)
Always throws MessagingException because no POP3 folders
can contain subfolders. |
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. |
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 |
getSize()
Return the size of this folder, as was returned by the POP3 STAT command when this folder was opened. |
int[] |
getSizes()
Return the sizes of all messages in this folder, as returned by the POP3 LIST command. |
int |
getType()
Always returns Folder.HOLDS_MESSAGES. |
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(String pattern)
Always throws MessagingException because no POP3 folders
can contain subfolders. |
InputStream |
listCommand()
Return the raw results of the POP3 LIST command with no arguments. |
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. |
| 从类 java.lang.Object 继承的方法 |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| 方法详细信息 |
|---|
public String getName()
Folder 复制的描述This method can be invoked on a closed Folder.
Folder 中的 getNamepublic String getFullName()
Folder 复制的描述This method can be invoked on a closed Folder.
Folder 中的 getFullNamepublic Folder getParent()
Folder 复制的描述Note that since Folder objects are not cached, invoking this method returns a new distinct Folder object.
Folder 中的 getParentpublic boolean exists()
Folder 中的 existsFolder.create(int)
public Folder[] list(String pattern)
throws MessagingException
MessagingException because no POP3 folders
can contain subfolders.
Folder 中的 listpattern - the match pattern
MessagingException - alwaysFolder.listSubscribed(java.lang.String)public char getSeparator()
Folder 中的 getSeparatorpublic int getType()
Folder 中的 getTypeFolder.HOLDS_FOLDERS,
Folder.HOLDS_MESSAGES
public boolean create(int type)
throws MessagingException
false; the POP3 protocol doesn't
support creating folders.
Folder 中的 createtype - The type of this folder.
MessagingExceptionFolder.HOLDS_FOLDERS,
Folder.HOLDS_MESSAGES,
FolderEvent
public boolean hasNewMessages()
throws MessagingException
false; the POP3 protocol provides
no way to determine when a new message arrives.
Folder 中的 hasNewMessagesFolderNotFoundException - if this folder does
not exist.
MessagingException
public Folder getFolder(String name)
throws MessagingException
MessagingException because no POP3 folders
can contain subfolders.
Folder 中的 getFoldername - name of the Folder
MessagingException - always
public boolean delete(boolean recurse)
throws MessagingException
MethodNotSupportedException
because the POP3 protocol doesn't allow the INBOX to
be deleted.
Folder 中的 deleteMethodNotSupportedException - always
FolderNotFoundException - if this folder does
not exist
MessagingExceptionFolderEvent
public boolean renameTo(Folder f)
throws MessagingException
MethodNotSupportedException
because the POP3 protocol doesn't support multiple folders.
Folder 中的 renameTof - a folder representing the new name for this Folder
MethodNotSupportedException - always
FolderNotFoundException - if this folder does
not exist
MessagingExceptionFolderEvent
public void open(int mode)
throws MessagingException
FolderNotFoundException unless this
folder is named "INBOX".
Folder 中的 openmode - open the Folder READ_ONLY or READ_WRITE
FolderNotFoundException - if not INBOX
AuthenticationException - authentication failures
MessagingException - other open failuresFolder.READ_ONLY,
Folder.READ_WRITE,
Folder.getType(),
ConnectionEvent
public 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.
Folder 中的 closeexpunge - expunges all deleted messages if this flag is true
MessagingExceptionConnectionEventpublic boolean isOpen()
Folder 复制的描述
Folder 中的 isOpenpublic Flags getPermanentFlags()
Flags object because
the POP3 protocol doesn't support any permanent flags.
Folder 中的 getPermanentFlags
public int getMessageCount()
throws MessagingException
Folder 中的 getMessageCountFolderNotFoundException - 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.
Folder 中的 getMessagemsgno - the message number
FolderNotFoundException - if this folder does
not exist.
MessagingExceptionFolder.getMessageCount(),
Folder.fetch(javax.mail.Message[], javax.mail.FetchProfile)
protected POP3Message createMessage(Folder f,
int msgno)
throws MessagingException
MessagingException
public void appendMessages(Message[] msgs)
throws MessagingException
MethodNotSupportedException
because the POP3 protocol doesn't support appending messages.
Folder 中的 appendMessagesmsgs - array of Messages to be appended
MethodNotSupportedException - always
FolderNotFoundException - if this folder does
not exist.
MessagingException - if the append failed.
public 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.
Folder 中的 expungeMethodNotSupportedException - always
FolderNotFoundException - if this folder does not
exist
MessagingExceptionMessage.isExpunged(),
MessageCountEvent
public 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.
Folder 中的 fetchmsgs - fetch items for these messagesfp - the FetchProfile
MessagingException
public String getUID(Message msg)
throws MessagingException
MessagingException
public int getSize()
throws MessagingException
IllegalStateException - if the folder isn't open
MessagingException
public int[] getSizes()
throws MessagingException
IllegalStateException - if the folder isn't open
MessagingException
public InputStream listCommand()
throws MessagingException,
IOException
IllegalStateException - if the folder isn't open
MessagingException
IOException
protected void finalize()
throws Throwable
Folder 中的 finalizeThrowable
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.
Folder 中的 notifyMessageChangedListeners
|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||