📄 session.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc on Fri Feb 18 09:56:02 PST 2000 -->
<TITLE>
JavaMail 1.1 API documentation: Class Session
</TITLE>
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style">
</HEAD>
<BODY BGCOLOR="white">
<!-- ========== START OF NAVBAR ========== -->
<A NAME="navbar_top"><!-- --></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" ID="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" ID="NavBarCell1"> <A HREF="../../overview-summary.html"><FONT ID="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" ID="NavBarCell1"> <A HREF="package-summary.html"><FONT ID="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" ID="NavBarCell1Rev"> <FONT ID="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" ID="NavBarCell1"> <A HREF="class-use/Session.html"><FONT ID="NavBarFont1"><B>Use</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" ID="NavBarCell1"> <A HREF="package-tree.html"><FONT ID="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" ID="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT ID="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" ID="NavBarCell1"> <A HREF="../../index-files/index-1.html"><FONT ID="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" ID="NavBarCell1"> <A HREF="../../help-doc.html"><FONT ID="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" ID="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../javax/mail/Service.html"><B>PREV CLASS</B></A>
<A HREF="../../javax/mail/Store.html"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" ID="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../index.html" TARGET="_top"><B>FRAMES</B></A>
<A HREF="Session.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD>
</TR>
<TR>
<TD VALIGN="top" ID="NavBarCell3"><FONT SIZE="-2">
SUMMARY: INNER | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" ID="NavBarCell3"><FONT SIZE="-2">
DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<!-- =========== END OF NAVBAR =========== -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
javax.mail</FONT>
<BR>
Class Session</H2>
<PRE>
java.lang.Object
|
+--<B>javax.mail.Session</B>
</PRE>
<HR>
<DL>
<DT>public final class <B>Session</B><DT>extends java.lang.Object</DL>
<P>
The Session class represents a mail session and is not subclassed.
It collects together properties and defaults used by the mail API's.
A single default session can be shared by multiple applications on the
desktop. Unshared sessions can also be created.
<P>
<HR>
<P>
<!-- ======== INNER CLASS SUMMARY ======== -->
<!-- =========== FIELD SUMMARY =========== -->
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" ID="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Method Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../javax/mail/Session.html#getDebug()">getDebug</A></B>()</CODE>
<BR>
Get the debug setting for this Session.</TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static <A HREF="../../javax/mail/Session.html">Session</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../javax/mail/Session.html#getDefaultInstance(java.util.Properties, javax.mail.Authenticator)">getDefaultInstance</A></B>(java.util.Properties props,
<A HREF="../../javax/mail/Authenticator.html">Authenticator</A> authenticator)</CODE>
<BR>
Get the default Session object.</TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../javax/mail/Folder.html">Folder</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../javax/mail/Session.html#getFolder(javax.mail.URLName)">getFolder</A></B>(<A HREF="../../javax/mail/URLName.html">URLName</A> url)</CODE>
<BR>
Get a closed Folder object for the given URLName.</TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static <A HREF="../../javax/mail/Session.html">Session</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../javax/mail/Session.html#getInstance(java.util.Properties, javax.mail.Authenticator)">getInstance</A></B>(java.util.Properties props,
<A HREF="../../javax/mail/Authenticator.html">Authenticator</A> authenticator)</CODE>
<BR>
Get a new Session object.</TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../javax/mail/PasswordAuthentication.html">PasswordAuthentication</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../javax/mail/Session.html#getPasswordAuthentication(javax.mail.URLName)">getPasswordAuthentication</A></B>(<A HREF="../../javax/mail/URLName.html">URLName</A> url)</CODE>
<BR>
Return any saved PasswordAuthentication for this (store or transport)
URLName.</TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.util.Properties</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../javax/mail/Session.html#getProperties()">getProperties</A></B>()</CODE>
<BR>
Returns the Properties object associated with this Session</TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../javax/mail/Session.html#getProperty(java.lang.String)">getProperty</A></B>(java.lang.String name)</CODE>
<BR>
Returns the value of the specified property.</TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../javax/mail/Provider.html">Provider</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../javax/mail/Session.html#getProvider(java.lang.String)">getProvider</A></B>(java.lang.String protocol)</CODE>
<BR>
Returns the default Provider for the protocol
specified.</TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../javax/mail/Provider.html">Provider</A>[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../javax/mail/Session.html#getProviders()">getProviders</A></B>()</CODE>
<BR>
This method returns an array of all the implementations installed
via the javamail.[default.]providers files that can
be loaded using the ClassLoader available to this application.</TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../javax/mail/Store.html">Store</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../javax/mail/Session.html#getStore()">getStore</A></B>()</CODE>
<BR>
Get a Store object that implements this user's desired Store
protcol.</TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../javax/mail/Store.html">Store</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../javax/mail/Session.html#getStore(javax.mail.Provider)">getStore</A></B>(<A HREF="../../javax/mail/Provider.html">Provider</A> provider)</CODE>
<BR>
Get an instance of the store specified by Provider.</TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../javax/mail/Store.html">Store</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../javax/mail/Session.html#getStore(java.lang.String)">getStore</A></B>(java.lang.String protocol)</CODE>
<BR>
Get a Store object that implements the specified protocol.</TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../javax/mail/Store.html">Store</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../javax/mail/Session.html#getStore(javax.mail.URLName)">getStore</A></B>(<A HREF="../../javax/mail/URLName.html">URLName</A> url)</CODE>
<BR>
Get a Store object for the given URLName.</TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../javax/mail/Transport.html">Transport</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../javax/mail/Session.html#getTransport()">getTransport</A></B>()</CODE>
<BR>
Get a Transport object that implements this user's desired
Transport protcol.</TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../javax/mail/Transport.html">Transport</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../javax/mail/Session.html#getTransport(javax.mail.Address)">getTransport</A></B>(<A HREF="../../javax/mail/Address.html">Address</A> address)</CODE>
<BR>
Get a Transport object that can transport a Message to the
specified address type.</TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../javax/mail/Transport.html">Transport</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../javax/mail/Session.html#getTransport(javax.mail.Provider)">getTransport</A></B>(<A HREF="../../javax/mail/Provider.html">Provider</A> provider)</CODE>
<BR>
Get an instance of the transport specified in the Provider.</TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../javax/mail/Transport.html">Transport</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../javax/mail/Session.html#getTransport(java.lang.String)">getTransport</A></B>(java.lang.String protocol)</CODE>
<BR>
Get a Transport object that implements the specified protocol.</TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../javax/mail/Transport.html">Transport</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../javax/mail/Session.html#getTransport(javax.mail.URLName)">getTransport</A></B>(<A HREF="../../javax/mail/URLName.html">URLName</A> url)</CODE>
<BR>
Get a Transport object for the given URLName.</TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../javax/mail/PasswordAuthentication.html">PasswordAuthentication</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../javax/mail/Session.html#requestPasswordAuthentication(java.net.InetAddress, int, java.lang.String, java.lang.String, java.lang.String)">requestPasswordAuthentication</A></B>(java.net.InetAddress addr,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -