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

📄 proxyutils.java

📁 Xfire文件 用于开发web service 的一个开源工具 很好用的
💻 JAVA
字号:
package org.codehaus.xfire.transport.http;import java.net.Proxy;import java.net.ProxySelector;import java.net.URI;import java.net.URISyntaxException;import java.util.List;/** * @author <a href="mailto:tsztelak@gmail.com">Tomasz Sztelak</a> * */public class ProxyUtils {	public boolean isNonProxyHost(String strURI) {		URI uri = null;		try {			uri = new URI(strURI);		} catch (URISyntaxException use) { // this should actually not happen,											// but just			// in case.			return false;		}		// ... get a system platform ProxySelector, and ...		ProxySelector ps = ProxySelector.getDefault();		// ... let this selector return a list of proxies.		List proxies = ps.select(uri);		// If that lists sole element is of type Proxy.NO_PROXY		// then we need a direct connection, otherwise we need to connect		// through a proxy.		if (proxies.size() == 1 && proxies.get(0).equals(Proxy.NO_PROXY)) {			return true;		}		return false;	}}

⌨️ 快捷键说明

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