folder.html

来自「SUN公司官方J2EE中文帮助文档 应该不错 有兴趣的下来看看 html格式的」· HTML 代码 · 共 1,389 行 · 第 1/5 页

HTML
1,389
字号
<A NAME="getURLName()"><!-- --></A><H3>
getURLName</H3>
<PRE>
public <A HREF="../../javax/mail/URLName.html">URLName</A> <B>getURLName</B>()
                   throws <A HREF="../../javax/mail/MessagingException.html">MessagingException</A></PRE>
<DL>
<DD>Return a URLName representing this folder.  The returned URLName
 does <em>not</em> include the password used to access the store.<DD><DL>
<DT><B>Returns:</B><DD>the URLName representing this folder<DT><B>Since: </B><DD>JavaMail 1.1</DD>
<DT><B>See Also: </B><DD><A HREF="../../javax/mail/URLName.html"><CODE>URLName</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="getStore()"><!-- --></A><H3>
getStore</H3>
<PRE>
public <A HREF="../../javax/mail/Store.html">Store</A> <B>getStore</B>()</PRE>
<DL>
<DD>Returns the Store that owns this Folder object.
 This method can be invoked on a closed Folder.<DD><DL>
<DT><B>Returns:</B><DD>the Store</DL>
</DD>
</DL>
<HR>

<A NAME="getParent()"><!-- --></A><H3>
getParent</H3>
<PRE>
public abstract <A HREF="../../javax/mail/Folder.html">Folder</A> <B>getParent</B>()
                          throws <A HREF="../../javax/mail/MessagingException.html">MessagingException</A></PRE>
<DL>
<DD>Returns the parent folder of this folder.
 This method can be invoked on a closed Folder. If this folder
 is the top of a folder hierarchy, this method returns null. <p>

 Note that since Folder objects are not cached, invoking this method
 returns a new distinct Folder object.<DD><DL>
<DT><B>Returns:</B><DD>Parent folder</DL>
</DD>
</DL>
<HR>

<A NAME="exists()"><!-- --></A><H3>
exists</H3>
<PRE>
public abstract boolean <B>exists</B>()
                        throws <A HREF="../../javax/mail/MessagingException.html">MessagingException</A></PRE>
<DL>
<DD>Tests if this folder physically exists on the Store.
 This method can be invoked on a closed Folder.<DD><DL>
<DT><B>Returns:</B><DD>true if the folder exists, otherwise false<DT><B>Throws:</B><DD><CODE><A HREF="../../javax/mail/MessagingException.html">MessagingException</A></CODE> - typically if the connection 
			to the server is lost.<DT><B>See Also: </B><DD><A HREF="../../javax/mail/Folder.html#create(int)"><CODE>create(int)</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="list(java.lang.String)"><!-- --></A><H3>
list</H3>
<PRE>
public abstract <A HREF="../../javax/mail/Folder.html">Folder</A>[] <B>list</B>(java.lang.String&nbsp;pattern)
                       throws <A HREF="../../javax/mail/MessagingException.html">MessagingException</A></PRE>
<DL>
<DD>Returns a list of Folders belonging to this Folder's namespace
 that match the specified pattern. Patterns may contain the wildcard
 characters <code>"%"</code>, which matches any character except hierarchy
 delimiters, and <code>"*"</code>, which matches any character. <p>

 As an example, given the folder hierarchy: <pre>
    Personal/
       Finance/
          Stocks
          Bonus
          StockOptions
       Jokes
 </pre>
 <code>list("*")</code> on "Personal" will return the whole 
 hierarchy. <br>
 <code>list("%")</code> on "Personal" will return "Finance" and 
 "Jokes". <br>
 <code>list("Jokes")</code> on "Personal" will return "Jokes".<br>
 <code>list("Stock*")</code> on "Finance" will return "Stocks"
 and "StockOptions". <p>

 Folder objects are not cached by the Store, so invoking this
 method on the same pattern multiple times will return that many
 distinct Folder objects. <p>

 This method can be invoked on a closed Folder.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>pattern</CODE> - the match pattern<DT><B>Returns:</B><DD>array of matching Folder objects. An empty
			array is returned if no matching Folders exist.<DT><B>Throws:</B><DD><CODE><A HREF="../../javax/mail/FolderNotFoundException.html">FolderNotFoundException</A></CODE> - if this folder does 
			not exist.<DD><CODE><A HREF="../../javax/mail/MessagingException.html">MessagingException</A></CODE> - &nbsp;<DT><B>See Also: </B><DD><A HREF="../../javax/mail/Folder.html#listSubscribed(java.lang.String)"><CODE>listSubscribed(java.lang.String)</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="listSubscribed(java.lang.String)"><!-- --></A><H3>
listSubscribed</H3>
<PRE>
public <A HREF="../../javax/mail/Folder.html">Folder</A>[] <B>listSubscribed</B>(java.lang.String&nbsp;pattern)
                        throws <A HREF="../../javax/mail/MessagingException.html">MessagingException</A></PRE>
<DL>
<DD>Returns a list of subscribed Folders belonging to this Folder's
 namespace that match the specified pattern. If the folder does
 not support subscription, this method should resolve to
 <code>list</code>.
 (The default implementation provided here, does just this).
 The pattern can contain wildcards as for <code>list</code>. <p>

 Folder objects are not cached by the Store, so invoking this
 method on the same pattern multiple times will return that many
 distinct Folder objects. <p>

 This method can be invoked on a closed Folder.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>pattern</CODE> - the match pattern<DT><B>Returns:</B><DD>array of matching subscribed Folder objects. An
			empty array is returned of no matching
			subscribed folders exist.<DT><B>Throws:</B><DD><CODE><A HREF="../../javax/mail/FolderNotFoundException.html">FolderNotFoundException</A></CODE> - if this folder does
			not exist.<DD><CODE><A HREF="../../javax/mail/MessagingException.html">MessagingException</A></CODE> - &nbsp;<DT><B>See Also: </B><DD><A HREF="../../javax/mail/Folder.html#list(java.lang.String)"><CODE>list(java.lang.String)</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="list()"><!-- --></A><H3>
list</H3>
<PRE>
public <A HREF="../../javax/mail/Folder.html">Folder</A>[] <B>list</B>()
              throws <A HREF="../../javax/mail/MessagingException.html">MessagingException</A></PRE>
<DL>
<DD>Convenience method that returns the list of folders under this
 Folder. This method just calls the <code>list(String pattern)</code>
 method with <code>"%"</code> as the match pattern. This method can
 be invoked on a closed Folder.<DD><DL>
<DT><B>Returns:</B><DD>array of Folder objects under this Folder. An
			empty array is returned if no subfolders exist.<DT><B>Throws:</B><DD><CODE><A HREF="../../javax/mail/FolderNotFoundException.html">FolderNotFoundException</A></CODE> - if this folder does
			not exist.<DD><CODE><A HREF="../../javax/mail/MessagingException.html">MessagingException</A></CODE> - &nbsp;<DT><B>See Also: </B><DD><A HREF="../../javax/mail/Folder.html#list(java.lang.String)"><CODE>list(java.lang.String)</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="listSubscribed()"><!-- --></A><H3>
listSubscribed</H3>
<PRE>
public <A HREF="../../javax/mail/Folder.html">Folder</A>[] <B>listSubscribed</B>()
                        throws <A HREF="../../javax/mail/MessagingException.html">MessagingException</A></PRE>
<DL>
<DD>Convenience method that returns the list of subscribed folders 
 under this Folder. This method just calls the
 <code>listSubscribed(String pattern)</code> method with <code>"%"</code>
 as the match pattern. This method can be invoked on a closed Folder.<DD><DL>
<DT><B>Returns:</B><DD>array of subscribed Folder objects under this 
			Folder. An empty array is returned if no subscribed 
			subfolders exist.<DT><B>Throws:</B><DD><CODE><A HREF="../../javax/mail/FolderNotFoundException.html">FolderNotFoundException</A></CODE> - if this folder does
			not exist.<DD><CODE><A HREF="../../javax/mail/MessagingException.html">MessagingException</A></CODE> - &nbsp;<DT><B>See Also: </B><DD><A HREF="../../javax/mail/Folder.html#listSubscribed(java.lang.String)"><CODE>listSubscribed(java.lang.String)</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="getSeparator()"><!-- --></A><H3>
getSeparator</H3>
<PRE>
public abstract char <B>getSeparator</B>()
                           throws <A HREF="../../javax/mail/MessagingException.html">MessagingException</A></PRE>
<DL>
<DD>Return the delimiter character that separates this Folder's pathname
 from the names of immediate subfolders. This method can be invoked 
 on a closed Folder.<DD><DL>
<DT><B>Returns:</B><DD>Hierarchy separator character<DT><B>Throws:</B><DD><CODE><A HREF="../../javax/mail/FolderNotFoundException.html">FolderNotFoundException</A></CODE> - if this folder does 
			not exist</DL>
</DD>
</DL>
<HR>

<A NAME="getType()"><!-- --></A><H3>
getType</H3>
<PRE>
public abstract int <B>getType</B>()
                     throws <A HREF="../../javax/mail/MessagingException.html">MessagingException</A></PRE>
<DL>
<DD>Returns the type of this Folder, that is, whether this folder can hold
 messages or subfolders or both. The returned value is an integer
 bitfield with the appropriate bits set. This method can be invoked
 on a closed folder.<DD><DL>
<DT><B>Returns:</B><DD>integer with appropriate bits set<DT><B>Throws:</B><DD><CODE><A HREF="../../javax/mail/FolderNotFoundException.html">FolderNotFoundException</A></CODE> - if this folder does 
			not exist.<DT><B>See Also: </B><DD><A HREF="../../javax/mail/Folder.html#HOLDS_FOLDERS"><CODE>HOLDS_FOLDERS</CODE></A>, 
<A HREF="../../javax/mail/Folder.html#HOLDS_MESSAGES"><CODE>HOLDS_MESSAGES</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="create(int)"><!-- --></A><H3>
create</H3>
<PRE>
public abstract boolean <B>create</B>(int&nbsp;type)
                        throws <A HREF="../../javax/mail/MessagingException.html">MessagingException</A></PRE>
<DL>
<DD>Create this folder on the Store. When this folder is created, any
 folders in its path that do not exist are also created. <p>

 If the creation is successful, a CREATED FolderEvent is delivered
 to any FolderListeners registered on this Folder and this Store.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>type</CODE> - The type of this folder.<DT><B>Returns:</B><DD>true if the creation succeeds, else false.<DT><B>Throws:</B><DD><CODE><A HREF="../../javax/mail/MessagingException.html">MessagingException</A></CODE> - &nbsp;<DT><B>See Also: </B><DD><A HREF="../../javax/mail/Folder.html#HOLDS_FOLDERS"><CODE>HOLDS_FOLDERS</CODE></A>, 
<A HREF="../../javax/mail/Folder.html#HOLDS_MESSAGES"><CODE>HOLDS_MESSAGES</CODE></A>, 
<A HREF="../../javax/mail/event/FolderEvent.html"><CODE>FolderEvent</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="isSubscribed()"><!-- --></A><H3>
isSubscribed</H3>
<PRE>
public boolean <B>isSubscribed</B>()</PRE>
<DL>
<DD>Returns true if this Folder is subscribed. <p>

 This method can be invoked on a closed Folder. <p>

 The default implementation provided here just returns true.<DD><DL>
<DT><B>Returns:</B><DD>true if this Folder is subscribed</DL>
</DD>
</DL>
<HR>

<A NAME="setSubscribed(boolean)"><!-- --></A><H3>
setSubscribed</H3>
<PRE>
public void <B>setSubscribed</B>(boolean&nbsp;subscribe)
                   throws <A HREF="../../javax/mail/MessagingException.html">MessagingException</A></PRE>
<DL>
<DD>Subscribe or unsubscribe this Folder. Not all Stores support
 subscription. <p>

 This method can be invoked on a closed Folder. <p>

 The implementation provided here just throws the
 MethodNotSupportedException.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>subscribe</CODE> - true to subscribe, false to unsubscribe<DT><B>Throws:</B><DD><CODE><A HREF="../../javax/mail/FolderNotFoundException.html">FolderNotFoundException</A></CODE> - if this folder does
			not exist.<DD><CODE><A HREF="../../javax/mail/MethodNotSupportedException.html">MethodNotSupportedException</A></CODE> - if this store
			does not support subscription<DD><CODE><A HREF="../../javax/mail/MessagingException.html">MessagingException</A></CODE> - &nbsp;</DL>
</DD>
</DL>
<HR>

<A NAME="hasNewMessages()"><!-- --></A><H3>
hasNewMessages</H3>
<PRE>
public abstract boolean <B>hasNewMessages</B>()
                                throws <A HREF="../../javax/mail/MessagingException.html">MessagingException</A></PRE>
<DL>
<DD>Returns true if this Folder has new messages since the last time
 this indication was reset.  When this indication is set or reset
 depends on the Folder implementation (and in the case of IMAP,
 depends on the server).  This method can be used to implement
 a lightweight "check for new mail" operation on a Folder without
 opening it.  (For example, a thread that monitors a mailbox and
 flags when it has new mail.)  This method should indicate whether
 any messages in the Folder have the <code>RECENT</code> flag set. <p>

 Note that this is not an incremental check for new mail, i.e.,
 it cannot be used to determine whether any new messages have
 arrived since the last time this method was invoked. To
 implement incremental checks, the Folder needs to be opened. <p>

 This method can be invoked on a closed Folder that can contain
 Messages.<DD><DL>
<DT><B>Returns:</B><DD>true if the Store has new Messages<DT><B>Throws:</B><DD><CODE><A HREF="../../javax/mail/FolderNotFoundException.html">FolderNotFoundException</A></CODE> - if this folder does
			not exist.<DD><CODE><A HREF="../../javax/mail/MessagingException.html">MessagingException</A></CODE> - &nbsp;</DL>
</DD>
</DL>
<HR>

<A NAME="getFolder(java.lang.String)"><!-- --></A><H3>
getFolder</H3>
<PRE>
public abstract <A HREF="../../javax/mail/Folder.html">Folder</A> <B>getFolder</B>(java.lang.String&nbsp;name)
                          throws <A HREF="../../javax/mail/MessagingException.html">MessagingException</A></PRE>
<DL>
<DD>Return the Folder object corresponding to the given name. Note that
 this folder does not physically have to exist in the Store. The

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?