本文整理了Java中org.apache.commons.httpclient.protocol.Protocol.resolvePort()
方法的一些代码示例,展示了Protocol.resolvePort()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Protocol.resolvePort()
方法的具体详情如下:
包路径:org.apache.commons.httpclient.protocol.Protocol
类名称:Protocol
方法名:resolvePort
[英]Resolves the correct port for this protocol. Returns the given port if valid or the default port otherwise.
[中]解析此协议的正确端口。如果有效,则返回给定端口,否则返回默认端口。
代码示例来源:origin: commons-httpclient/commons-httpclient
/**
* Creates a new HTTP connection for the given host with the virtual
* alias and port via the given proxy host and port using the given
* protocol.
*
* @param proxyHost the host to proxy via
* @param proxyPort the port to proxy via
* @param host the host to connect to. Parameter value must be non-null.
* @param port the port to connect to
* @param protocol The protocol to use. Parameter value must be non-null.
*/
public HttpConnection(
String proxyHost,
int proxyPort,
String host,
int port,
Protocol protocol) {
if (host == null) {
throw new IllegalArgumentException("host parameter is null");
}
if (protocol == null) {
throw new IllegalArgumentException("protocol is null");
}
proxyHostName = proxyHost;
proxyPortNumber = proxyPort;
hostName = host;
portNumber = protocol.resolvePort(port);
protocolInUse = protocol;
}
代码示例来源:origin: org.apache.commons/com.springsource.org.apache.commons.httpclient
/**
* Creates a new HTTP connection for the given host with the virtual
* alias and port via the given proxy host and port using the given
* protocol.
*
* @param proxyHost the host to proxy via
* @param proxyPort the port to proxy via
* @param host the host to connect to. Parameter value must be non-null.
* @param port the port to connect to
* @param protocol The protocol to use. Parameter value must be non-null.
*/
public HttpConnection(
String proxyHost,
int proxyPort,
String host,
int port,
Protocol protocol) {
if (host == null) {
throw new IllegalArgumentException("host parameter is null");
}
if (protocol == null) {
throw new IllegalArgumentException("protocol is null");
}
proxyHostName = proxyHost;
proxyPortNumber = proxyPort;
hostName = host;
portNumber = protocol.resolvePort(port);
protocolInUse = protocol;
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-httpclient
/**
* Creates a new HTTP connection for the given host with the virtual
* alias and port via the given proxy host and port using the given
* protocol.
*
* @param proxyHost the host to proxy via
* @param proxyPort the port to proxy via
* @param host the host to connect to. Parameter value must be non-null.
* @param port the port to connect to
* @param protocol The protocol to use. Parameter value must be non-null.
*/
public HttpConnection(
String proxyHost,
int proxyPort,
String host,
int port,
Protocol protocol) {
if (host == null) {
throw new IllegalArgumentException("host parameter is null");
}
if (protocol == null) {
throw new IllegalArgumentException("protocol is null");
}
proxyHostName = proxyHost;
proxyPortNumber = proxyPort;
hostName = host;
portNumber = protocol.resolvePort(port);
protocolInUse = protocol;
}
代码示例来源:origin: org.mule.transports/mule-transport-http
/**
* Creates a new HTTP connection for the given host with the virtual
* alias and port via the given proxy host and port using the given
* protocol.
*
* @param proxyHost the host to proxy via
* @param proxyPort the port to proxy via
* @param host the host to connect to. Parameter value must be non-null.
* @param port the port to connect to
* @param protocol The protocol to use. Parameter value must be non-null.
*/
public HttpConnection(
String proxyHost,
int proxyPort,
String host,
int port,
Protocol protocol) {
if (host == null) {
throw new IllegalArgumentException("host parameter is null");
}
if (protocol == null) {
throw new IllegalArgumentException("protocol is null");
}
proxyHostName = proxyHost;
proxyPortNumber = proxyPort;
hostName = host;
portNumber = protocol.resolvePort(port);
protocolInUse = protocol;
}
代码示例来源:origin: org.apache.commons/httpclient
/**
* Creates a new HTTP connection for the given host with the virtual
* alias and port via the given proxy host and port using the given
* protocol.
*
* @param proxyHost the host to proxy via
* @param proxyPort the port to proxy via
* @param host the host to connect to. Parameter value must be non-null.
* @param port the port to connect to
* @param protocol The protocol to use. Parameter value must be non-null.
*/
public HttpConnection(
String proxyHost,
int proxyPort,
String host,
int port,
Protocol protocol) {
if (host == null) {
throw new IllegalArgumentException("host parameter is null");
}
if (protocol == null) {
throw new IllegalArgumentException("protocol is null");
}
proxyHostName = proxyHost;
proxyPortNumber = proxyPort;
hostName = host;
portNumber = protocol.resolvePort(port);
protocolInUse = protocol;
}
代码示例来源:origin: org.wso2.commons-httpclient/commons-httpclient
/**
* Creates a new HTTP connection for the given host with the virtual
* alias and port via the given proxy host and port using the given
* protocol.
*
* @param proxyHost the host to proxy via
* @param proxyPort the port to proxy via
* @param host the host to connect to. Parameter value must be non-null.
* @param port the port to connect to
* @param protocol The protocol to use. Parameter value must be non-null.
*/
public HttpConnection(
String proxyHost,
int proxyPort,
String host,
int port,
Protocol protocol) {
if (host == null) {
throw new IllegalArgumentException("host parameter is null");
}
if (protocol == null) {
throw new IllegalArgumentException("protocol is null");
}
proxyHostName = proxyHost;
proxyPortNumber = proxyPort;
hostName = host;
portNumber = protocol.resolvePort(port);
protocolInUse = protocol;
}
代码示例来源:origin: org.zaproxy/zap
/**
* Creates a new HTTP connection for the given host with the virtual
* alias and port via the given proxy host and port using the given
* protocol.
*
* @param proxyHost the host to proxy via
* @param proxyPort the port to proxy via
* @param host the host to connect to. Parameter value must be non-null.
* @param port the port to connect to
* @param protocol The protocol to use. Parameter value must be non-null.
*/
public HttpConnection(
String proxyHost,
int proxyPort,
String host,
int port,
Protocol protocol) {
if (host == null) {
throw new IllegalArgumentException("host parameter is null");
}
if (protocol == null) {
throw new IllegalArgumentException("protocol is null");
}
proxyHostName = proxyHost;
proxyPortNumber = proxyPort;
hostName = host;
portNumber = protocol.resolvePort(port);
protocolInUse = protocol;
}
代码示例来源:origin: slide/slide-webdavlib
return httpURL.getHost().equalsIgnoreCase(hostConfig.getHost())
&& httpURL.getPort()
== hostConfig.getProtocol().resolvePort(hostConfig.getPort());
内容来源于网络,如有侵权,请联系作者删除!