org.apache.commons.httpclient.HttpConnection.getHost()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(4.3k)|赞(0)|评价(0)|浏览(165)

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

HttpConnection.getHost介绍

[英]Returns the host.
[中]返回主机。

代码示例

代码示例来源:origin: commons-httpclient/commons-httpclient

public String getHost() {
  if (hasConnection()) {
    return wrappedConnection.getHost();
  } else {
    return null;
  }
}

代码示例来源:origin: commons-httpclient/commons-httpclient

/**
 * Creates a new HttpConnectionAdapter.
 * @param connection the connection to be wrapped
 */
public HttpConnectionAdapter(HttpConnection connection) {
  super(connection.getHost(), connection.getPort(), connection.getProtocol());
  this.wrappedConnection = connection;
}

代码示例来源:origin: commons-httpclient/commons-httpclient

buf.append(protocol.getScheme().toLowerCase());
buf.append("://");
buf.append(connection.getHost());
if ((connection.getPort() != -1) 
  && (connection.getPort() != protocol.getDefaultPort())

代码示例来源:origin: commons-httpclient/commons-httpclient

host = method.getParams().getVirtualHost();
if (host == null) {
  host = conn.getHost();

代码示例来源:origin: commons-httpclient/commons-httpclient

LOG.debug("Using virtual host name: " + host);
} else {
  host = conn.getHost();

代码示例来源:origin: commons-httpclient/commons-httpclient

port = conn.getProtocol().getDefaultPort();  
buffer.append(conn.getHost()); 
buffer.append(':'); 
buffer.append(port);

代码示例来源:origin: commons-httpclient/commons-httpclient

if (!this.host.getHostName().equalsIgnoreCase(connection.getHost())) {
  return false;

代码示例来源:origin: commons-httpclient/commons-httpclient

host = proxy ? conn.getProxyHost() : conn.getHost();

代码示例来源:origin: commons-httpclient/commons-httpclient

host = conn.getHost();

代码示例来源:origin: commons-httpclient/commons-httpclient

host = conn.getHost();

代码示例来源:origin: commons-httpclient/commons-httpclient

String host = method.getParams().getVirtualHost();
if (host == null) {
  host = conn.getHost();

代码示例来源:origin: commons-httpclient/commons-httpclient

if (s == null && count == 0) {
  throw new NoHttpResponseException("The server " + conn.getHost() + 
    " failed to respond");
} else if (s == null || count >= maxGarbageLines) {
  throw new ProtocolException("The server " + conn.getHost() + 
      " failed to respond with a valid HTTP response");

代码示例来源:origin: commons-httpclient/commons-httpclient

this.conn.getProtocol().getScheme(),
null,
this.conn.getHost(), 
this.conn.getPort(), 
method.getPath()

代码示例来源:origin: commons-httpclient/commons-httpclient

/**
 * Gets the host configuration for a connection.
 * @param conn the connection to get the configuration of
 * @return a new HostConfiguration
 */
private HostConfiguration configurationForConnection(HttpConnection conn) {
  HostConfiguration connectionConfiguration = new HostConfiguration();
  
  connectionConfiguration.setHost(
    conn.getHost(), 
    conn.getPort(), 
    conn.getProtocol()
  );
  if (conn.getLocalAddress() != null) {
    connectionConfiguration.setLocalAddress(conn.getLocalAddress());
  }
  if (conn.getProxyHost() != null) {
    connectionConfiguration.setProxy(conn.getProxyHost(), conn.getProxyPort());
  }
  return connectionConfiguration;
}

代码示例来源:origin: commons-httpclient/commons-httpclient

String host = this.params.getVirtualHost();
if (host == null) {
  host = conn.getHost();

代码示例来源:origin: org.apache.commons/com.springsource.org.apache.commons.httpclient

public String getHost() {
  if (hasConnection()) {
    return wrappedConnection.getHost();
  } else {
    return null;
  }
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-httpclient

public String getHost() {
  if (hasConnection()) {
    return wrappedConnection.getHost();
  } else {
    return null;
  }
}

代码示例来源:origin: org.sonatype.nexus/nexus-proxy

public String getHost() {
  if (hasConnection()) {
    return wrappedConnection.getHost();
  } else {
    return null;
  }
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-httpclient

/**
 * Creates a new HttpConnectionAdapter.
 * @param connection the connection to be wrapped
 */
public HttpConnectionAdapter(HttpConnection connection) {
  super(connection.getHost(), connection.getPort(), connection.getProtocol());
  this.wrappedConnection = connection;
}

代码示例来源:origin: org.sonatype.nexus/nexus-proxy

/**
 * Creates a new HttpConnectionAdapter.
 * @param connection the connection to be wrapped
 */
public HttpConnectionAdapter(HttpConnection connection) {
  super(connection.getHost(), connection.getPort(), connection.getProtocol());
  this.wrappedConnection = connection;
}

相关文章

微信公众号

最新文章

更多

HttpConnection类方法