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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? rule.java

?? 很棒的web服務(wù)器源代碼
?? JAVA
字號(hào):
// RuleParserException.java// $Id: Rule.java,v 1.8 2000/08/16 21:38:05 ylafon Exp $// (c) COPYRIGHT MIT and INRIA, 1998.// Please first read the full copyright statement in file COPYRIGHT.htmlpackage org.w3c.www.protocol.http.proxy ;import java.net.MalformedURLException;import java.net.URL;import java.io.DataOutputStream;import java.io.IOException;import org.w3c.www.protocol.http.Reply;import org.w3c.www.protocol.http.Request;import org.w3c.www.http.HTTP;import org.w3c.www.http.HttpCredential;import org.w3c.www.http.HttpEntityMessage;import org.w3c.www.http.HttpFactory;import org.w3c.www.http.HttpMessage;import org.w3c.www.http.HttpRequestMessage;import org.w3c.tools.codec.Base64Encoder;import org.w3c.tools.sorter.Comparable;/** * The ForbidRule implements the <code>forbid</code> directive. * Forbid prevents all accesses, by the client (be it a proxy or hotjava) * to a given set of hosts. */class ForbidRule extends Rule {    /**     * Forbid access to the given request.     * @param request The request to apply the rule too.     */    public Reply apply(Request request) {	Reply reply = request.makeReply(HTTP.OK);	reply.setContent("<h1>Access forbidden</h1>"			 + "<p>Access to "+request.getURL()			 + " is forbidden by proxy dispatcher rules.");	reply.setContentType(org.w3c.www.mime.MimeType.TEXT_HTML);	return reply;    }    /**     * Initialize a forbid rule.     * @param tokens The token array.     * @param offset Offset within above array, of tokens to initialize      * from.     * @param length Total number of tokens in above array.     * @exception RuleParserExctpion If the rule couldn't be initialized     * from given tokens.     */    public void initialize(String tokens[], int offset, int length) 	throws RuleParserException    {	super.initialize(tokens, offset, length);    }       public ForbidRule() {	name = "forbid";    }}class ProxyRule extends Rule {    URL proxy = null;    /**     * Convert a proxy rule to a String.     * @return A String instance.     */    public String toString() {	return host+" "+name+" "+proxy;    }    /**     * Set the appropriate proxy for the given requested URL.     * @param request The request to apply the rule to.     * @return Always <strong>null</strong>, will only hack the given      * request     * if needed.     */    public Reply apply(Request request) {	if ( proxy != null )	    request.setProxy(proxy);	return null;    }    /**     * Initialize that proxy rule.     * @param tokens The token array.     * @param offset Offset within above array, of tokens to initialize      * from.     * @param length Total number of tokens in above array.     * @exception RuleParserExctpion If the rule couldn't be initialized     * from given tokens.     */    public void initialize(String tokens[], int offset, int length) 	throws RuleParserException    {	// We have to get the proxy here	if ( offset+1 != length )	    throw new RuleParserException("No target proxy.");	try {	    args  = tokens[offset];	    proxy = new URL(args);	} catch (MalformedURLException ex) {	    throw new RuleParserException("Invalid target proxy \""					  + tokens[offset]					  + "\".");	}	host = tokens[0];    }    public ProxyRule() {	name = "proxy";    }}class RedirectRule extends Rule {    URL redirect = null;    /**     * Convert a redirect rule to a String.     * @return A String instance.     */    public String toString() {	return host+" "+name+" "+redirect;    }    /**     * Set the appropriate redirect URL for the given requested URL.     * @param request The request to apply the rule to.     * @return Always <strong>null</strong>, will only hack the given      * request     * if needed.     */    public Reply apply(Request request) {	if ( redirect != null )	    request.setURL(redirect);	return null;    }    /**     * Initialize that redirect rule.     * @param tokens The token array.     * @param offset Offset within above array, of tokens to initialize     * from.     * @param length Total number of tokens in above array.     * @exception RuleParserExctpion If the rule couldn't be initialized     * from given tokens.     */    public void initialize(String tokens[], int offset, int length) 	throws RuleParserException    {	// We have to get the redirect URL here	if ( offset+1 != length )	    throw new RuleParserException("No target redirect URL.");	try {	    args  = tokens[offset];	    redirect = new URL(args);	} catch (MalformedURLException ex) {	    throw new RuleParserException("Invalid target redirect URL \""					  + tokens[offset]					  + "\".");	}	host = tokens[0];    }    public RedirectRule() {	name = "redirect";    }}/** * The DirectRule implements the <code>DIRECT</code> directive. * Applying that rule is basically a <em>noop</em>. */class DirectRule extends Rule {    public DirectRule() {	name = "direct";    }}/** * The authorization rule adds Basic credentials to all requests. */class AuthorizationRule extends Rule {    /**     * The credentials to add to the request.     */    HttpCredential credential = null;    String user     = null;    String password = null;    public String toString() {	return host+" "+name+" "+user+" "+password;    }    /**     * Appky this rule to the given request.     * @param request The request to apply the rule to.     * @return Always <strong>null</strong>.     */    public Reply apply(Request request) {	if ( ! request.hasHeader(HttpRequestMessage.H_AUTHORIZATION) )	    request.setHeaderValue(HttpRequestMessage.H_AUTHORIZATION				   , credential);	return null;    }    /**     * Initialize this Authorization rule.     * @param tokens The token array.     * @param offset Offset within above array, of tokens to initialize     * from.     * @param length Total number of tokens in above array.     * @exception RuleParserExctpion If the rule couldn't be initialized     * from given tokens.     */    public void initialize(String tokens[], int offset, int length) 	throws RuleParserException     {	if ( offset + 2 != length ) 	    throw new RuleParserException("Invalid authorization rule: "					  + " should be authorization "					  + " <user> <password>.");	credential = HttpFactory.makeCredential("Basic");	user = tokens[offset];	password = tokens[offset+1];	args = user+" "+password;	Base64Encoder base64 = new Base64Encoder(user						 + ":"						 + password);	credential.setAuthParameter("cookie", base64.processString());	host = tokens[0];    }    public AuthorizationRule() {	name = "authorization";    }}class ProxyAuthRule extends Rule {    URL proxy = null;    /**     * The credentials to add to the request.     */    HttpCredential credential = null;    String user     = null;    String password = null;    /**     * Convert a proxy rule to a String.     * @return A String instance.     */    public String toString() {	return host+" "+name+" "+user+" "+password+" "+proxy;    }    /**     * Set the appropriate proxy for the given requested URL.     * @param request The request to apply the rule to.     * @return Always <strong>null</strong>, will only hack the given      * request     * if needed.     */    public Reply apply(Request request) {	if ( proxy != null )	    request.setProxy(proxy);	if ( ! request.hasHeader(HttpRequestMessage.H_PROXY_AUTHORIZATION) )	    request.setProxyAuthorization(credential);	return null;    }    /**     * Initialize that proxy rule.     * @param tokens The token array.     * @param offset Offset within above array, of tokens to initialize      * from.     * @param length Total number of tokens in above array.     * @exception RuleParserExctpion If the rule couldn't be initialized     * from given tokens.     */    public void initialize(String tokens[], int offset, int length) 	throws RuleParserException    {	// We have to get the proxy here	if ( offset+3 != length )	    throw new RuleParserException("Invalid proxyauth rule: "					  + " should be authorization "					  + " <user> <password> <proxy>.");	try {	    user = tokens[offset];	    password = tokens[offset+1];	    credential = HttpFactory.makeCredential("Basic");	    Base64Encoder base64 = new Base64Encoder(user						     + ":"						     + password);	    credential.setAuthParameter("cookie", base64.processString());	    proxy = new URL(tokens[offset+2]);	    args = user+" "+password+" "+proxy;	} catch (MalformedURLException ex) {	    throw new RuleParserException("Invalid target proxy \""					  + tokens[offset]					  + "\".");	}	host = tokens[0];    }    public ProxyAuthRule() {	name = "proxyauth";    }}public class Rule implements Comparable {    protected static String names[] = {"direct", "forbid", "proxy", 				       "redirect", "authorization",				       "proxyauth"};    String host = null;    String args = null;    String name = null;    public String toString() {	return host+" "+name;    }    public String getStringValue() {	return toString();    }    public boolean greaterThan(Comparable comp) {	return (getStringValue().compareTo(comp.getStringValue()) > 0);    }    public void writeRule(DataOutputStream out)	throws IOException    {	out.writeBytes(toString()+"\n");    }    public String getHost() {	return host;    }    public String getRuleName() {	return name;    }    public String getRuleArgs() {	return args;    }    /**     * Initialize the rule with given set of tokens.     * @param tokens The token array.     * @param offset Offset within above array, of tokens to initialize from.     * @param length Total number of tokens in above array.     * @exception RuleParserException If the rule couldn't be initialized     * from given tokens.     */    protected void initialize(String tokens[], int offset, int length) 	throws RuleParserException    {	if ( offset != length )	    throw new RuleParserException("Unexpected token: "+tokens[offset]);	host = tokens[0];    }    /**     * Create a rule, given an array of String.     * @param tokens Parsed tokens, as a String array.     * @param offset Offset of the rule tokens within above array.     * @param length Total number of available tokens.     * @exception RuleParserException If no rule could be created out of given     * tokens.     */    public static Rule createRule(String tokens[], int offset, int length)	throws RuleParserException    {	Rule rule = null;	// Make sure there is something to build:	if ((tokens == null) || (length-offset == 0))	    return null;	// Check the rule name:	String name = tokens[offset];	if ( name.equalsIgnoreCase("direct") ) {	    rule = new DirectRule();	} else if ( name.equalsIgnoreCase("proxy") ) {	    rule = new ProxyRule();	} else if ( name.equalsIgnoreCase("forbid") ) {	    rule = new ForbidRule();	} else if ( name.equalsIgnoreCase("redirect") ) {	    rule = new RedirectRule();	} else if ( name.equalsIgnoreCase("authorization") ) {	    rule = new AuthorizationRule();	} else if ( name.equalsIgnoreCase("proxyauth") ) {	    rule = new ProxyAuthRule();	} else {	    throw new RuleParserException("Unknown rule name \""+name+"\"");	}	rule.initialize(tokens, offset+1, length);	return rule;    }    public static String[] getRulesName() {	return names;    }    /**     * Apply given rule to the given request.     * @param request The request to apply the rule to.     */    public Reply apply(Request request) {	return null;    }    /**     * Empty constructor for dynamic instantiation.     */    public Rule() {    }}

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91在线精品一区二区| 午夜婷婷国产麻豆精品| 国产成人午夜99999| 久久毛片高清国产| 成人黄色小视频在线观看| 国产精品人妖ts系列视频| 99精品欧美一区二区三区综合在线| 国产精品午夜在线观看| 91小视频在线观看| 亚洲bdsm女犯bdsm网站| 欧美成人女星排名| 成人永久免费视频| 亚洲免费电影在线| 日韩三级高清在线| 成人激情综合网站| 亚洲h动漫在线| 国产喂奶挤奶一区二区三区| 色综合久久中文综合久久牛| 蜜臀91精品一区二区三区| 国产精品家庭影院| 欧美亚洲一区二区在线| 国内精品不卡在线| 亚洲综合一区二区| 久久亚洲一区二区三区四区| 色欲综合视频天天天| 老鸭窝一区二区久久精品| 国产精品色在线| 51精品久久久久久久蜜臀| 成人精品国产免费网站| 三级在线观看一区二区| 国产精品久久二区二区| 欧美一区二区成人6969| 色综合久久88色综合天天6| 久久国产精品露脸对白| 亚洲美女区一区| 国产婷婷精品av在线| 欧美日韩精品一区二区天天拍小说| 国内精品免费在线观看| 婷婷亚洲久悠悠色悠在线播放| 中文字幕精品三区| 精品美女被调教视频大全网站| 在线中文字幕不卡| 成人av在线播放网址| 久久国产婷婷国产香蕉| 亚洲女人的天堂| 国产日韩高清在线| 精品国产电影一区二区| 欧美日韩你懂的| 91麻豆自制传媒国产之光| 国产乱子轮精品视频| 婷婷丁香久久五月婷婷| 亚洲另类一区二区| 久久久久久久精| 精品久久久久久综合日本欧美| 在线观看日韩高清av| 成人国产免费视频| 国产成人aaa| 国内不卡的二区三区中文字幕 | 欧美一卡2卡3卡4卡| 91在线你懂得| 大白屁股一区二区视频| 久久国产三级精品| 精品综合久久久久久8888| 亚洲成人免费视频| 亚洲欧洲中文日韩久久av乱码| 欧美国产精品一区| 久久精品一区四区| 国产日韩精品一区二区三区 | 中文字幕不卡在线播放| 26uuu成人网一区二区三区| 9191精品国产综合久久久久久 | 欧美日韩一级黄| 欧美日韩精品欧美日韩精品一 | 九九热在线视频观看这里只有精品| 亚洲男同1069视频| 亚洲欧美日韩成人高清在线一区| 中文久久乱码一区二区| 国产精品女主播在线观看| 国产精品免费观看视频| 中文字幕一区视频| 中文字幕一区av| 国产精品黄色在线观看| 亚洲欧美日韩成人高清在线一区| 亚洲精品一卡二卡| 婷婷综合五月天| 麻豆精品精品国产自在97香蕉 | 精品对白一区国产伦| 精品美女在线播放| 国产日韩欧美电影| 亚洲激情图片qvod| 午夜精品久久久久久久| 免费不卡在线观看| 国产成人亚洲精品青草天美| 成人av网站免费| 欧美中文字幕一区二区三区 | 日韩欧美在线观看一区二区三区| 欧美一二区视频| 国产婷婷色一区二区三区| 亚洲三级在线免费| 日本在线观看不卡视频| 韩国精品一区二区| 91麻豆国产在线观看| 欧美人与z0zoxxxx视频| 精品国产乱码久久久久久夜甘婷婷| 久久精品一区八戒影视| 亚洲欧美日韩久久| 久久er99精品| 色乱码一区二区三区88| 日韩一区二区三区视频在线| 欧美国产亚洲另类动漫| 亚洲免费看黄网站| 极品少妇xxxx偷拍精品少妇| 99久久99久久综合| 日韩一区二区在线看| 国产精品视频线看| 免费成人在线观看| 91免费版在线看| 久久久久亚洲蜜桃| 天天色天天操综合| 成人av手机在线观看| 日韩欧美一级特黄在线播放| 日韩美女久久久| 国产露脸91国语对白| 在线观看日韩av先锋影音电影院| 精品捆绑美女sm三区| 伊人性伊人情综合网| 国产精品中文字幕日韩精品 | 一本色道久久综合精品竹菊| 欧美mv和日韩mv的网站| 亚洲色欲色欲www在线观看| 波多野结衣中文字幕一区二区三区 | 欧美一区二区免费| 成人免费福利片| 日韩一级成人av| 亚洲人成网站色在线观看| 久久av老司机精品网站导航| 欧美性感一区二区三区| 国产精品麻豆网站| 国产在线国偷精品产拍免费yy| 在线观看日产精品| 中文字幕亚洲综合久久菠萝蜜| 久久99精品国产.久久久久久| 欧美美女一区二区| 一区二区三区国产| youjizz久久| 国产精品网友自拍| 国产精品亚洲а∨天堂免在线| 91精品国产综合久久久久久| 一区二区三区在线免费观看| 不卡在线视频中文字幕| 久久久久久久av麻豆果冻| 日产精品久久久久久久性色| 欧美性视频一区二区三区| 中文字幕一区在线观看视频| 成人性生交大片免费看视频在线| 精品国产一区二区国模嫣然| 蜜桃av一区二区三区| 51精品国自产在线| 日韩精品成人一区二区在线| 日本韩国一区二区| 一区二区三区中文字幕精品精品| 99精品视频在线免费观看| 中文字幕不卡三区| 95精品视频在线| 亚洲欧美另类久久久精品| 91丨porny丨在线| 成人免费一区二区三区视频| 99热在这里有精品免费| 综合欧美亚洲日本| 色综合久久中文综合久久97| 亚洲免费看黄网站| 精品视频一区二区三区免费| 性久久久久久久久久久久| 在线91免费看| 韩国毛片一区二区三区| 国产欧美日韩综合精品一区二区| 国产精品一二二区| 亚洲欧美乱综合| 欧美精品日韩一本| 国产原创一区二区| 国产精品区一区二区三区| 色综合久久88色综合天天6 | 亚洲精品在线免费观看视频| 精品影院一区二区久久久| 久久久久高清精品| 99久久婷婷国产| 亚洲一区二区三区四区五区黄| 4438x亚洲最大成人网| 美国三级日本三级久久99| 久久综合精品国产一区二区三区| 国产成人精品一区二区三区网站观看| 亚洲欧洲性图库| 欧美日韩国产成人在线免费| 美女一区二区三区| 中文字幕一区二区视频| 欧美日韩高清一区二区| 国产九色精品成人porny | 欧美精品国产精品| 国产精品91xxx| 亚洲国产精品综合小说图片区|