⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 javamail-1.4-changes.txt

📁 Java mail client (get all message on mails erver)
💻 TXT
📖 第 1 页 / 共 3 页
字号:
public class PreencodedMimeBodyPart extends MimeBodyPart {    /**     * Create a PreencodedMimeBodyPart that assumes the data is     * encoded using the specified encoding.  The encoding must     * be a MIME supported Content-Transfer-Encoding.     */    public PreencodedMimeBodyPart(String encoding)}===================================================================13. Add MimeBodyPart attachFile and saveFile methods (6301390)--------------------------------------------------------------It's very common for applications to create messages with filesas attachments, and to receive attachments and save them in files.To simplify this usable, we add several convenience methods to theMimeBodyPart class:    /**     * Use the specified file to provide the data for this part.     * The simple file name is used as the file name for this     * part and the data in the file is used as the data for this     * part.  The encoding will be chosen appropriately for the     * file data.     *     * @param		file		the File object to attach     * @exception	IOException	errors related to accessing the file     * @exception	MessagingException	message related errors     * @since		JavaMail 1.4     */    public void attachFile(File file) throws IOException, MessagingException    /**     * Use the specified file to provide the data for this part.     * The simple file name is used as the file name for this     * part and the data in the file is used as the data for this     * part.  The encoding will be chosen appropriately for the     * file data.     *     * @param		file		the name of the file to attach     * @exception	IOException	errors related to accessing the file     * @exception	MessagingException	message related errors     * @since		JavaMail 1.4     */    public void attachFile(String file) throws IOException, MessagingException    /**     * Save the contents of this part in the specified file.  The content     * is decoded and saved, without any of the MIME headers.     *     * @param		file		the File object to write to     * @exception	IOException	errors related to accessing the file     * @exception	MessagingException	message related errors     * @since		JavaMail 1.4     */    public void saveFile(File file) throws IOException, MessagingException    /**     * Save the contents of this part in the specified file.  The content     * is decoded and saved, without any of the MIME headers.     *     * @param		file		the name of the file to write to     * @exception	IOException	errors related to accessing the file     * @exception	MessagingException	message related errors     * @since		JavaMail 1.4     */    public void saveFile(String file) throws IOException, MessagingException===================================================================14. Add MimeUtility fold and unfold methods (6302118)--------------------------------------------------------------When dealing with long header lines, it's often necessary to foldthe lines to avoid exceeding line length limitations.  When retrievingthe data from such headers, the folding needs to be undone.  The JavaMailimplementation includes private fold and unfold methods for this purpose.These methods should be made public.    /**     * Fold a string at linear whitespace so that each line is no longer     * than 76 characters, if possible.  If there are more than 76     * non-whitespace characters consecutively, the string is folded at     * the first whitespace after that sequence.  The parameter     * <code>used</code> indicates how many characters have been used in     * the current line; it is usually the length of the header name. <p>     *     * Note that line breaks in the string aren't escaped; they probably     * should be.     *     * @param	used	characters used in line so far     * @param	s	the string to fold     * @return		the folded string     */    public static String fold(int used, String s)    /**     * Unfold a folded header.  Any line breaks that aren't escaped and     * are followed by whitespace are removed.     *     * @param	s	the string to unfold     * @return		the unfolded string     */    public static String unfold(String s)===================================================================15. Allow more control over headers in InternetHeaders object (6302832)-----------------------------------------------------------------------Some applications, such as mail server applications, need more controlover the order of headers in the InternetHeaders class.  To supportsuch usage, we allow such applications to subclass InternetHeadersand access the List of headers directly.  InternetHeaders exposes aprotected field:    protected List headers;The elements of the list are objects of a new protected final classInternetHeaders.InternetHeader that extends the javax.mail.Header class.To allow the InternetHeader class to make use of the Header class, wemake the following fields of Header protected:    /**     * The name of the header.     *     * @since	JavaMail 1.4     */    protected String name;    /**     * The value of the header.     *     * @since	JavaMail 1.4     */    protected String value;===================================================================16. Allow applications to dynamically register new protocol providers (6302835)-----------------------------------------------------------------------Some applications would like to register new protocol providers at runtimerather than depending on the JavaMail configuration files and resources.To support such usage we make the constructor for the Provider classpublic:    /**     * Create a new provider of the specified type for the specified     * protocol.  The specified class implements the provider.     *     * @param type      Type.STORE or Type.TRANSPORT     * @param protocol  valid protocol for the type     * @param classname class name that implements this protocol     * @param vendor    optional string identifying the vendor (may be null)     * @param version   optional implementation version string (may be null)     * @since JavaMail 1.4     */    public Provider(Type type, String protocol, String classname, 	     String vendor, String version)We also add a new method to Session to allow registering such Providers:    /**     * Add a provider to the session.     *     * @param	provider	the provider to add     * @since	JavaMail 1.4     */    public void addProvider(Provider provider)===================================================================17. Allow applications to dynamically register address type mappings (4377727)------------------------------------------------------------------------------Along with the above item, some applications will want to dynamicallycontrol the mapping from address type to protocol.  This could alsobe used to change the default internet protocol from "smtp" to "smtps".We add the following method to Session:    /**     * Set the default transport protocol to use for addresses of     * the specified type.  Normally the default is set by the     * <code>javamail.default.address.map</code> or     * <code>javamail.address.map</code> files or resources.     *     * @param	addresstype	type of address     * @param	protocol	name of protocol     * @see #getTransport(Address)     * @since	JavaMail 1.4     */    public void setProtocolForAddress(String addresstype, String protocol)===================================================================18. ParameterList class should support non US-ASCII parameters (4107342)------------------------------------------------------------------------RFC 2231 describes a method for encoding non-ASCII parameters in MIMEheaders.  We introduce the following System properties to controlencoding and decoding such parameters.If the mail.mime.encodeparameters System property is set to "true".non-ASCII parameters will be encoded per RFC 2231.If the mail.mime.decodeparameters System property is set to "true".parameters encoded per RFC 2231 will be decoded.Both of these properties default to "false".Note that RFC 2231 also describes a technique for splitting longparameter values across multiple parameters.  We do not plan tosupport such parameter continuations.To allow specifying the charset to use for a parameter, we addthe following method to ParameterList:    /**     * Set a parameter. If this parameter already exists, it is     * replaced by this new value.  If the     * <code>mail.mime.encodeparameters</code> System property     * is true, and the parameter value is non-ASCII, it will be     * encoded with the specified charset.     *     * @param	name 	name of the parameter.     * @param	value	value of the parameter.     * @param	charset	charset of the parameter value.     * @since	JavaMail 1.4     */    public void set(String name, String value, String charset)===================================================================19. Standard interface for Stores that support quotas (6304051)---------------------------------------------------------------Some IMAP stores support quotas.  To allow applications to makeuse of quota support without depending on IMAP-specific APIs,we provide a QuotaAwareStore interface that Stores, such as theIMAP Store, can implement.  We also provide a Quota class torepresent a set of quotas for a quota root.package javax.mail;/** * An interrface implemented by Stores that support quotas. * The {@link #getQuota getQuota} and {@link #setQuota setQuota} methods * support the quota model defined by the IMAP QUOTA extension. * Refer to <A HREF="http://www.ietf.org/rfc/rfc2087.txt">RFC 2087</A> * for more information. <p> * * @since JavaMail 1.4 */public interface QuotaAwareStore {    /**     * Get the quotas for the named quota root.     * Quotas are controlled on the basis of a quota root, not     * (necessarily) a folder.  The relationship between folders     * and quota roots depends on the server.  Some servers     * might implement a single quota root for all folders owned by     * a user.  Other servers might implement a separate quota root     * for each folder.  A single folder can even have multiple     * quota roots, perhaps controlling quotas for different     * resources.     *     * @param	root	the name of the quota root     * @return		array of Quota objects     * @exception MessagingException	if the server doesn't support the     *					QUOTA extension     */    Quota[] getQuota(String root) throws MessagingException;    /**     * Set the quotas for the quota root specified in the quota argument.     * Typically this will be one of the quota roots obtained from the     * <code>getQuota</code> method, but it need not be.     *     * @param	quota	the quota to set     * @exception MessagingException	if the server doesn't support the     *					QUOTA extension     */    void setQuota(Quota quota) throws MessagingException;}package javax.mail;/** * This class represents a set of quotas for a given quota root. * Each quota root has a set of resources, represented by the * <code>Quota.Resource</code> class.  Each resource has a name * (for example, "STORAGE"), a current usage, and a usage limit. * See RFC 2087. * * @since JavaMail 1.4 */public class Quota {    /**     * An individual resource in a quota root.     *     * @since JavaMail 1.4     */    public static class Resource {	/** The name of the resource. */	public String name;	/** The current usage of the resource. */	public long usage;	/** The usage limit for the resource. */	public long limit;	/**	 * Construct a Resource object with the given name,	 * usage, and limit.	 *	 * @param	name	the resource name	 * @param	usage	the current usage of the resource	 * @param	limit	the usage limit for the resource	 */	public Resource(String name, long usage, long limit)    }    /**     * The name of the quota root.     */    public String quotaRoot;    /**     * The set of resources associated with this quota root.     */    public Quota.Resource[] resources;    /**     * Create a Quota object for the named quotaroot with no associated     * resources.     *     * @param	quotaRoot	the name of the quota root     */    public Quota(String quotaRoot)    /**     * Set a resource limit for this quota root.     *     * @param	name	the name of the resource

⌨️ 快捷键说明

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