亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? mailaddress.java

?? 基于UDP的可靠郵件系統
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
/*********************************************************************** * Copyright (c) 2000-2004 The Apache Software Foundation.             * * All rights reserved.                                                * * ------------------------------------------------------------------- * * Licensed under the Apache License, Version 2.0 (the "License"); you * * may not use this file except in compliance with the License. You    * * may obtain a copy of the License at:                                * *                                                                     * *     http://www.apache.org/licenses/LICENSE-2.0                      * *                                                                     * * Unless required by applicable law or agreed to in writing, software * * distributed under the License is distributed on an "AS IS" BASIS,   * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or     * * implied.  See the License for the specific language governing       * * permissions and limitations under the License.                      * ***********************************************************************/package org.hwmhere.email.mailet;import java.util.Locale;/** * A representation of an email address. * <p> * This class encapsulates functionalities to access to different parts of an * email address without dealing with its parsing. * </p> *  * <p> * A MailAddress is an address specified in the MAIL FROM and RCPT TO commands * in SMTP sessions. These are either passed by an external server to the * mailet-compliant SMTP server, or they are created programmatically by the * mailet-compliant server to send to another (external) SMTP server. Mailets * and matchers use the MailAddress for the purpose of evaluating the sender and * recipient(s) of a message. * </p> *  * <p> * MailAddress parses an email address as defined in RFC 821 (SMTP) p. 30 and 31 * where addresses are defined in BNF convention. As the mailet API does not * support the aged "SMTP-relayed mail" addressing protocol, this leaves all * addresses to be a <mailbox>, as per the spec. The MailAddress's "user" is the * <local-part> of the <mailbox> and "host" is the <domain> of the mailbox. * </p> *  * <p> * This class is a good way to validate email addresses as there are some valid * addresses which would fail with a simpler approach to parsing address. It * also removes parsing burden from mailets and matchers that might not realize * the flexibility of an SMTP address. For instance, "serge@home"@lokitech.com * is a valid SMTP address (the quoted text serge@home is the user and * lokitech.com is the host). This means all current parsing to date is * incorrect as we just find the first @ and use that to separate user from * host. * </p> *  * <p> * This parses an address as per the BNF specification for <mailbox> from RFC * 821 on page 30 and 31, section 4.1.2. COMMAND SYNTAX. * http://www.freesoft.org/CIE/RFC/821/15.htm * </p> *  * @version 1.0 */public class MailAddress implements java.io.Serializable {	// We hardcode the serialVersionUID so that from James 1.2 on,	// MailAddress will be deserializable (so your mail doesn't get lost)	public static final long serialVersionUID = 2779163542539434916L;	private final static char[] SPECIAL = { '<', '>', '(', ')', '[', ']', '\\',			'.', ',', ';', ':', '@', '\"' };	private String user = null;	private String host = null;	// Used for parsing	private int pos = 0;	/**	 * <p>	 * Construct a MailAddress parsing the provided <code>String</code>	 * object.	 * </p>	 * 	 * <p>	 * The <code>personal</code> variable is left empty.	 * </p>	 * 	 * @param address	 *            the email address compliant to the RFC822 format	 * @throws ParseException	 *             if the parse failed	 */	public MailAddress(String address) throws Exception {		address = address.trim();		int i = address.indexOf('@');		if (1 == i) {		}		user = address.substring(0, i);		host = address.substring(i + 1);		// StringBuffer userSB = new StringBuffer();		// StringBuffer hostSB = new StringBuffer();		// //Begin parsing		// //<mailbox> ::= <local-part> "@" <domain>		//		// try {		// //parse local-part		// //<local-part> ::= <dot-string> | <quoted-string>		// if (address.charAt(pos) == '\"') {		// userSB.append(parseQuotedLocalPart(address));		// } else {		// userSB.append(parseUnquotedLocalPart(address));		// }		// if (userSB.toString().length() == 0) {		// throw new Exception("No local-part (user account) found at position "		// + (pos + 1));		// }		//		// //find @		// if (pos >= address.length() || address.charAt(pos) != '@') {		// throw new Exception("Did not find @ between local-part and domain at		// position " + (pos + 1));		// }		// pos++;		//		// //parse domain		// //<domain> ::= <element> | <element> "." <domain>		// //<element> ::= <name> | "#" <number> | "[" <dotnum> "]"		// while (true) {		// if (address.charAt(pos) == '#') {		// hostSB.append(parseNumber(address));		// } else if (address.charAt(pos) == '[') {		// hostSB.append(parseDotNum(address));		// } else {		// hostSB.append(parseDomainName(address));		// }		// if (pos >= address.length()) {		// break;		// }		// if (address.charAt(pos) == '.') {		// hostSB.append('.');		// pos++;		// continue;		// }		// break;		// }		//		// if (hostSB.toString().length() == 0) {		// throw new Exception("No domain found at position " + (pos + 1));		// }		// } catch (IndexOutOfBoundsException ioobe) {		// throw new Exception("Out of data at position " + (pos + 1));		// }		//		// user = userSB.toString();		// host = hostSB.toString();	}	/**	 * Construct a MailAddress with the provided personal name and email	 * address.	 * 	 * @param user	 *            the username or account name on the mail server	 * @param host	 *            the server that should accept messages for this user	 * @throws Exception	 *             if the parse failed	 */	public MailAddress(String newUser, String newHost) throws Exception {		/* NEEDS TO BE REWORKED TO VALIDATE EACH CHAR */		user = newUser;		host = newHost;	}	/**	 * Constructs a MailAddress from a JavaMail InternetAddress, using only the	 * email address portion, discarding the personal name.	 */	// public MailAddress(InternetAddress address) throws Exception {	// this(address.getAddress());	// }	/**	 * Return the host part.	 * 	 * @return a <code>String</code> object representing the host part of this	 *         email address. If the host is of the dotNum form (e.g.	 *         [yyy.yyy.yyy.yyy]) then strip the braces first.	 */	public String getHost() {		if (!(host.startsWith("[") && host.endsWith("]"))) {			return host;		} else {			return host.substring(1, host.length() - 1);		}	}	/**	 * Return the user part.	 * 	 * @return a <code>String</code> object representing the user part of this	 *         email address.	 * @throws AddressException	 *             if the parse failed	 */	public String getUser() {		return user;	}	public String toString() {		StringBuffer addressBuffer = new StringBuffer(128).append(user).append(				"@").append(host);		return addressBuffer.toString();	}	// public InternetAddress toInternetAddress() {	// try {	// return new InternetAddress(toString());	// } catch (javax.mail.internet.AddressException ae) {	// //impossible really	// return null;	// }	// }	public boolean equals(Object obj) {		if (obj == null) {			return false;		} else if (obj instanceof String) {			String theString = (String) obj;			return toString().equalsIgnoreCase(theString);		} else if (obj instanceof MailAddress) {			MailAddress addr = (MailAddress) obj;			return getUser().equalsIgnoreCase(addr.getUser())					&& getHost().equalsIgnoreCase(addr.getHost());		}		return false;	}	/**	 * Return a hashCode for this object which should be identical for addresses	 * which are equivalent. This is implemented by obtaining the default	 * hashcode of the String representation of the MailAddress. Without this	 * explicit definition, the default hashCode will create different hashcodes	 * for separate object instances.	 * 

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
午夜久久久久久电影| 欧美久久久一区| 欧美日韩国产美| 久久久久99精品国产片| 天堂蜜桃91精品| 99天天综合性| 久久久久久久久99精品| 日韩精品亚洲一区| 91猫先生在线| 国产欧美日韩视频一区二区| 五月婷婷久久综合| 欧洲人成人精品| 成人欧美一区二区三区| 韩国一区二区三区| 91精品国产综合久久精品性色| 亚洲视频一区二区在线观看| 国产精品一线二线三线| 日韩欧美国产综合一区| 天堂va蜜桃一区二区三区漫画版| 91亚洲资源网| 亚洲图片你懂的| 99精品热视频| 国产精品视频看| 国产精品白丝av| 久久精品男人的天堂| 国产一区二区日韩精品| 久久综合九色综合97婷婷女人 | 欧美日韩国产一区二区三区地区| 国产精品美女久久久久高潮| 国产成人h网站| 国产日韩欧美电影| 成人精品免费看| 国产精品看片你懂得| 99热国产精品| 亚洲免费av在线| 欧美专区在线观看一区| 亚洲成人资源在线| 91精品在线观看入口| 免费一区二区视频| 538在线一区二区精品国产| 午夜精品福利在线| 日韩色视频在线观看| 国产一区高清在线| 国产婷婷一区二区| 波多野结衣91| 一级中文字幕一区二区| 欧美日韩精品电影| 毛片不卡一区二区| 久久综合九色综合97婷婷| 懂色av中文一区二区三区| 中文字幕制服丝袜一区二区三区 | 69av一区二区三区| 秋霞电影网一区二区| 亚洲精品一区二区三区影院| 国产精品一区二区果冻传媒| 国产精品久久久久久福利一牛影视| 99久久综合精品| 亚洲国产精品一区二区久久恐怖片 | 国产香蕉久久精品综合网| 成人sese在线| 午夜伦理一区二区| 国产无一区二区| 欧美亚洲禁片免费| 国产一区在线视频| 亚洲色欲色欲www| 欧美一区二区在线播放| 成人网在线免费视频| 午夜欧美大尺度福利影院在线看| 26uuu亚洲综合色| 在线亚洲高清视频| 毛片基地黄久久久久久天堂| 自拍偷自拍亚洲精品播放| 69久久夜色精品国产69蝌蚪网| 国内偷窥港台综合视频在线播放| 中文字幕亚洲一区二区av在线| 在线播放欧美女士性生活| 国产麻豆精品视频| 午夜精品在线看| 国产精品免费网站在线观看| 91精品久久久久久蜜臀| 91污在线观看| 激情亚洲综合在线| 亚洲v日本v欧美v久久精品| 国产欧美日韩另类视频免费观看| 欧美色爱综合网| 99久久精品费精品国产一区二区| 麻豆精品久久久| 一区二区三区美女| 亚洲国产精品成人久久综合一区| 在线观看91av| 欧美亚洲日本国产| 成人一级视频在线观看| 精品影院一区二区久久久| 亚洲一二三专区| 亚洲免费在线观看视频| 国产日韩精品一区| 欧美精品一区二区三区久久久| 欧美精品v国产精品v日韩精品| 色婷婷综合久久久久中文| 国产精品1区二区.| 国产综合久久久久久鬼色| 日韩福利电影在线观看| 一区二区三区 在线观看视频 | 日韩免费观看高清完整版在线观看| 91福利区一区二区三区| 成人免费三级在线| 国产成人av电影在线播放| 免费成人你懂的| 青青草一区二区三区| 免费成人在线播放| 美女一区二区久久| 麻豆国产精品官网| 久久99精品国产91久久来源| 日韩黄色免费网站| 日韩高清不卡一区| 美女mm1313爽爽久久久蜜臀| 日本欧美一区二区三区乱码| 午夜激情久久久| 午夜欧美一区二区三区在线播放| 亚洲国产一二三| 日日摸夜夜添夜夜添亚洲女人| 日韩精品一卡二卡三卡四卡无卡 | 一区二区三区日韩欧美| 亚洲免费高清视频在线| 亚洲一区二区综合| 五月天中文字幕一区二区| 日本视频在线一区| 久久精品二区亚洲w码| 国产精品538一区二区在线| 成人免费看视频| 欧美综合欧美视频| 91精品国产综合久久精品app| 日韩一区二区三区四区| 久久久99久久| 亚洲欧美日韩中文字幕一区二区三区| 中文字幕一区二区三| 亚洲国产成人av好男人在线观看| 琪琪久久久久日韩精品| 国产乱码字幕精品高清av| 97久久超碰国产精品| 欧美视频一区二区三区| 日韩午夜在线观看视频| 欧美国产乱子伦| 一区二区三区四区在线| 99re亚洲国产精品| 色就色 综合激情| 欧美一区在线视频| 中文字幕一区在线观看| 午夜精品久久一牛影视| 国产成人啪免费观看软件| 色婷婷久久久亚洲一区二区三区| 欧美乱妇23p| 国产精品天天看| 五月激情丁香一区二区三区| 国产999精品久久| 欧美性猛交一区二区三区精品| 日韩欧美综合一区| 亚洲女爱视频在线| 久久国产人妖系列| 91成人网在线| 国产日韩欧美精品在线| 午夜精品一区在线观看| 成人中文字幕电影| 欧美一区二区美女| 亚洲少妇最新在线视频| 激情图片小说一区| 在线观看免费亚洲| 国产精品系列在线| 麻豆一区二区三| 欧美专区日韩专区| 欧美国产日本视频| 精品一区二区久久久| 欧洲精品中文字幕| 国产精品免费观看视频| 免费成人在线播放| 欧美精品丝袜久久久中文字幕| 中文字幕第一区第二区| 久久99精品久久久久久久久久久久| 91免费看视频| 中文字幕乱码日本亚洲一区二区| 久久精品国产一区二区三区免费看 | 欧美一级艳片视频免费观看| 亚洲视频在线一区二区| 不卡在线观看av| 久久久久久久久久美女| 久久99久久精品欧美| 91精品国产综合久久香蕉的特点| 一区二区三区在线观看网站| jiyouzz国产精品久久| 国产视频亚洲色图| 国产成人精品亚洲777人妖 | 麻豆成人av在线| 制服丝袜成人动漫| 亚洲成人动漫一区| 欧美专区日韩专区| 亚洲成年人影院| 欧美日本一道本| 五月天中文字幕一区二区| 3d动漫精品啪啪1区2区免费| 午夜欧美视频在线观看|