<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<!-- Generated by javadoc (build 1.6.0_10) on Tue Nov 17 12:13:38 PST 2009 -->
<
META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
UIDFolder (JavaMail API documentation)
<
META NAME="date" CONTENT="2009-11-17">
<
LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style">
<
SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="UIDFolder (JavaMail API documentation)";
}
}
<
BODY BGCOLOR="white" onload="windowTitle();">
<!-- ========= START OF TOP NAVBAR ======= -->
<
A NAME="navbar_top"><!-- --><
/A>
<
A HREF="#skip-navbar_top" title="Skip navigation links"><
/A>
<
TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<
TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<
A NAME="navbar_top_firstrow"><!-- --><
/A>
<
TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<
TR ALIGN="center" VALIGN="top">
<
TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <
A HREF="../../overview-summary.html"><
FONT CLASS="NavBarFont1"><
B>Overview<
/B><
/FONT><
/A> <
/TD>
<
TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <
A HREF="package-summary.html"><
FONT CLASS="NavBarFont1"><
B>Package<
/B><
/FONT><
/A> <
/TD>
<
TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <
FONT CLASS="NavBarFont1Rev"><
B>Class<
/B><
/FONT> <
/TD>
<
TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <
A HREF="class-use/UIDFolder.html"><
FONT CLASS="NavBarFont1"><
B>Use<
/B><
/FONT><
/A> <
/TD>
<
TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <
A HREF="package-tree.html"><
FONT CLASS="NavBarFont1"><
B>Tree<
/B><
/FONT><
/A> <
/TD>
<
TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <
A HREF="../../deprecated-list.html"><
FONT CLASS="NavBarFont1"><
B>Deprecated<
/B><
/FONT><
/A> <
/TD>
<
TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <
A HREF="../../index-files/index-1.html"><
FONT CLASS="NavBarFont1"><
B>Index<
/B><
/FONT><
/A> <
/TD>
<
TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <
A HREF="../../help-doc.html"><
FONT CLASS="NavBarFont1"><
B>Help<
/B><
/FONT><
/A> <
/TD>
<
TD ALIGN="right" VALIGN="top" ROWSPAN=3><
EM>
<
TD BGCOLOR="white" CLASS="NavBarCell2"><
FONT SIZE="-2">
<
A HREF="../../javax/mail/Transport.html" title="class in javax.mail"><
B>PREV CLASS<
/B><
/A>
<
A HREF="../../javax/mail/UIDFolder.FetchProfileItem.html" title="class in javax.mail"><
B>NEXT CLASS<
/B><
/A><
/FONT><
/TD>
<
TD BGCOLOR="white" CLASS="NavBarCell2"><
FONT SIZE="-2">
<
A HREF="../../index.html?javax/mail/UIDFolder.html" target="_top"><
B>FRAMES<
/B><
/A>
<
A HREF="UIDFolder.html" target="_top"><
B>NO FRAMES<
/B><
/A>
<
SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
<
A HREF="../../allclasses-noframe.html"><
B>All Classes<
/B><
/A>
<
TD VALIGN="top" CLASS="NavBarCell3"><
FONT SIZE="-2">
SUMMARY: <
A HREF="#nested_class_summary">NESTED<
/A> | <
A HREF="#field_summary">FIELD<
/A> | CONSTR | <
A HREF="#method_summary">METHOD<
/A><
/FONT><
/TD>
<
TD VALIGN="top" CLASS="NavBarCell3"><
FONT SIZE="-2">
DETAIL: <
A HREF="#field_detail">FIELD<
/A> | CONSTR | <
A HREF="#method_detail">METHOD<
/A><
/FONT><
/TD>
<
A NAME="skip-navbar_top"><
/A>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<
DT><
B>All Known Implementing Classes:<
/B> <
DD><
A HREF="../../com/sun/mail/imap/IMAPFolder.html" title="class in com.sun.mail.imap">IMAPFolder<
/A><
/DD>
<
DT><
PRE>public interface <
B>UIDFolder<
/B><
/DL>
The <
code>UIDFolder<
/code> interface is implemented by Folders
that can support the "disconnected" mode of operation, by providing
unique-ids for messages in the folder. This interface is based on
the IMAP model
for supporting disconnected operation. <
p>
A Unique identifier (UID) is a positive long value, assigned to
each message in a specific folder. Unique identifiers are assigned
in a strictly <
strong>ascending<
/strong> fashion in the mailbox.
That is, as each message is added to the mailbox it is assigned a
higher UID than the message(s) which were added previously. Unique
identifiers persist across sessions. This permits a client to
resynchronize its state from a previous session with the server. <
p>
Associated with every mailbox is a unique identifier validity value.
If unique identifiers from an earlier session fail to persist to
this session, the unique identifier validity value
<
strong>must<
/strong> be greater than the one used in the earlier
Refer to RFC
2060 <
A HREF="http://www.ietf.org/rfc/rfc2060.txt">
http:
//www.ietf.org
/rfc
/rfc2060.txt<
/A>
for more information.
<!-- ======== NESTED CLASS SUMMARY ======== -->
<
A NAME="nested_class_summary"><!-- --><
/A>
<
TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<
TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<
TH ALIGN="left" COLSPAN="2"><
FONT SIZE="+2">
<
TR BGCOLOR="white" CLASS="TableRowColor">
<
TD ALIGN="right" VALIGN="top" WIDTH="1%"><
FONT SIZE="-1">
<
TD><
CODE><
B><
A HREF="../../javax/mail/UIDFolder.FetchProfileItem.html" title="class in javax.mail">UIDFolder.FetchProfileItem<
/A><
/B><
/CODE>
A fetch
profile item
for fetching UIDs.<
/TD>
<!-- =========== FIELD SUMMARY =========== -->
<
A NAME="field_summary"><!-- --><
/A>
<
TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<
TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<
TH ALIGN="left" COLSPAN="2"><
FONT SIZE="+2">
<
TR BGCOLOR="white" CLASS="TableRowColor">
<
TD ALIGN="right" VALIGN="top" WIDTH="1%"><
FONT SIZE="-1">
<
TD><
CODE><
B><
A HREF="../../javax/mail/UIDFolder.html#LASTUID">LASTUID<
/A><
/B><
/CODE>
This is a special
value that can be used as the <
code>end<
/code>
parameter in <
code>getMessagesByUID
(start, end
)<
/code>, to denote the
UID of the last message in the folder.<
/TD>
<!-- ========== METHOD SUMMARY =========== -->
<
A NAME="method_summary"><!-- --><
/A>
<
TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<
TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<
TH ALIGN="left" COLSPAN="2"><
FONT SIZE="+2">
<
TR BGCOLOR="white" CLASS="TableRowColor">
<
TD ALIGN="right" VALIGN="top" WIDTH="1%"><
FONT SIZE="-1">
<
CODE> <
A HREF="../../javax/mail/Message.html" title="class in javax.mail">Message<
/A><
/CODE><
/FONT><
/TD>
<
TD><
CODE><
B><
A HREF="../../javax/mail/UIDFolder.html#getMessageByUID(long)">getMessageByUID<
/A><
/B>
(long uid
)<
/CODE>
Get the Message corresponding to the given UID.<
/TD>
<
TR BGCOLOR="white" CLASS="TableRowColor">
<
TD ALIGN="right" VALIGN="top" WIDTH="1%"><
FONT SIZE="-1">
<
CODE> <
A HREF="../../javax/mail/Message.html" title="class in javax.mail">Message<
/A>
[]<
/CODE><
/FONT><
/TD>
<
TD><
CODE><
B><
A HREF="../../javax/mail/UIDFolder.html#getMessagesByUID(long[])">getMessagesByUID<
/A><
/B>
(long
[] uids
)<
/CODE>
Get the Messages specified by the given array of UIDs.<
/TD>
<
TR BGCOLOR="white" CLASS="TableRowColor">
<
TD ALIGN="right" VALIGN="top" WIDTH="1%"><
FONT SIZE="-1">
<
CODE> <
A HREF="../../javax/mail/Message.html" title="class in javax.mail">Message<
/A>
[]<
/CODE><
/FONT><
/TD>
<
TD><
CODE><
B><
A HREF="../../javax/mail/UIDFolder.html#getMessagesByUID(long, long)">getMessagesByUID<
/A><
/B>
(long
start,
Get the Messages specified by the given range.<
/TD>
<
TR BGCOLOR="white" CLASS="TableRowColor">
<
TD ALIGN="right" VALIGN="top" WIDTH="1%"><
FONT SIZE="-1">
<
TD><
CODE><
B><
A HREF="../../javax/mail/UIDFolder.html#getUID(javax.mail.Message)">getUID<
/A><
/B>
(<
A HREF="../../javax/mail/Message.html" title="class in javax.mail">Message<
/A> message
)<
/CODE>
Get the UID
for the specified message.<
/TD>
<
TR BGCOLOR="white" CLASS="TableRowColor">
<
TD ALIGN="right" VALIGN="top" WIDTH="1%"><
FONT SIZE="-1">
<
TD><
CODE><
B><
A HREF="../../javax/mail/UIDFolder.html#getUIDValidity()">getUIDValidity<
/A><
/B>
()<
/CODE>
Returns the UIDValidity
value associated with this folder.<
/TD>
<!-- ============ FIELD DETAIL =========== -->
<
A NAME="field_detail"><!-- --><
/A>
<
TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<
TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<
TH ALIGN="left" COLSPAN="1"><
FONT SIZE="+2">
<
A NAME="LASTUID"><!-- --><
/A><
H3>
static final long <
B>LASTUID<
/B><
/PRE>
<
DD>This is a special
value that can be used as the <
code>end<
/code>
parameter in <
code>getMessagesByUID
(start, end
)<
/code>, to denote the
UID of the last message in the folder.
<
DT><
B>See Also:<
/B><
DD><
A HREF="../../javax/mail/UIDFolder.html#getMessagesByUID(long, long)"><
CODE>getMessagesByUID
(long, long
)<
/CODE><
/A>,
<
A HREF="../../constant-values.html#javax.mail.UIDFolder.LASTUID">Constant Field Values<
/A><
/DL>
<!-- ============ METHOD DETAIL ========== -->
<
A NAME="method_detail"><!-- --><
/A>
<
TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<
TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<
TH ALIGN="left" COLSPAN="1"><
FONT SIZE="+2">
<
A NAME="getUIDValidity()"><!-- --><
/A><
H3>
long <
B>getUIDValidity<
/B>
()
throws <
A HREF="../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException<
/A><
/PRE>
<
DD>Returns the UIDValidity
value associated with this folder. <
p>
Clients typically compare this value against a UIDValidity
value saved from a previous session to insure that any cached
UIDs are not stale.
<
DT><
B>Returns:<
/B><
DD>UIDValidity
<
DD><
CODE><
A HREF="../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException<
/A><
/CODE><
/DL>
<
A NAME="getMessageByUID(long)"><!-- --><
/A><
H3>
<
A HREF="../../javax/mail/Message.html" title="class in javax.mail">Message<
/A> <
B>getMessageByUID<
/B>
(long uid
)
throws <
A HREF="../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException<
/A><
/PRE>
<
DD>Get the Message corresponding to the given UID. If no such
message exists, <
code>null<
/code> is returned.
<
DT><
B>Parameters:<
/B><
DD><
CODE>uid<
/CODE> - UID
for the desired message
<
DT><
B>Returns:<
/B><
DD>the Message
object. <
code>null<
/code> is returned
if no message corresponding to this UID is obtained.
<
DD><
CODE><
A HREF="../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException<
/A><
/CODE><
/DL>
<
A NAME="getMessagesByUID(long, long)"><!-- --><
/A><
H3>
<
A HREF="../../javax/mail/Message.html" title="class in javax.mail">Message<
/A>
[] <
B>getMessagesByUID<
/B>
(long
start,
long end)
throws <
A HREF="../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException<
/A><
/PRE>
<
DD>Get the Messages specified by the given range. The special
value LASTUID can be used
for the <
code>end<
/code> parameter
to indicate the UID of the last message in the folder. <
p>
the order of the range doesn't matter.
Note also that, unless the folder is empty, use of LASTUID ensures
that at least one message will be returned - the last message in the
folder.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>start</CODE> - start UID<DD><CODE>end</CODE> - end UID
<DT><B>Returns:</B><DD>array of Message objects
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></CODE><DT><B>See Also:</B><DD><A HREF="../../javax/mail/UIDFolder.html#LASTUID"><CODE>LASTUID</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="getMessagesByUID(long[])"><!-- --></A><H3>
getMessagesByUID</H3>
<PRE>
<A HREF="../../javax/mail/Message.html" title="class in javax.mail">Message</A>[] <B>getMessagesByUID</B>(long[] uids)
throws <A HREF="../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></PRE>
<DL>
<DD>Get the Messages specified by the given array of UIDs. If any UID is
invalid, <code>null</code> is returned for that entry. <p>
Note that the returned array will be of the same size as the specified
array of UIDs, and <code>null</code> entries may be present in the
array to indicate invalid UIDs.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>uids</CODE> - array of UIDs
<DT><B>Returns:</B><DD>array of Message objects
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></CODE></DL>
</DD>
</DL>
<HR>
<A NAME="getUID(javax.mail.Message)"><!-- --></A><H3>
getUID</H3>
<PRE>
long <B>getUID</B>(<A HREF="../../javax/mail/Message.html" title="class in javax.mail">Message</A> message)
throws <A HREF="../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></PRE>
<DL>
<DD>Get the UID for the specified message. Note that the message
<strong>must</strong> belong to this folder. Otherwise
java.util.NoSuchElementException is thrown.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>message</CODE> - Message from this folder
<DT><B>Returns:</B><DD>UID for this message
<DT><B>Throws:</B>
<DD><CODE><A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/util/NoSuchElementException.html?is-external=true" title="class or interface in java.util">NoSuchElementException</A></CODE> - if the given Message
is not in this Folder.
<DD><CODE><A HREF="../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></CODE></DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/UIDFolder.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../javax/mail/Transport.html" title="class in javax.mail"><B>PREV CLASS</B></A>
<A HREF="../../javax/mail/UIDFolder.FetchProfileItem.html" title="class in javax.mail"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../index.html?javax/mail/UIDFolder.html" target="_top"><B>FRAMES</B></A>
<A HREF="UIDFolder.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<
A HREF="../../allclasses-noframe.html"><
B>All Classes<
/B><
/A>
');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: <A HREF="#nested_class_summary">NESTED</A> | <A HREF="#field_summary">FIELD</A> | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: <A HREF="#field_detail">FIELD</A> | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
Copyright © 2009 <a href="http://www.sun.com">Sun Microsystems, Inc.</a>. All Rights Reserved.
</BODY>
</HTML>