org.apache.commons.httpclient.protocol.Protocol.resolvePort()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(6.1k)|赞(0)|评价(0)|浏览(153)

本文整理了Java中org.apache.commons.httpclient.protocol.Protocol.resolvePort()方法的一些代码示例,展示了Protocol.resolvePort()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Protocol.resolvePort()方法的具体详情如下:
包路径:org.apache.commons.httpclient.protocol.Protocol
类名称:Protocol
方法名:resolvePort

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());

相关文章