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

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

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

HttpConnection.getParams介绍

[英]Returns HttpConnectionParams associated with this method.
[中]返回与此方法关联的HttpConnectionParams。

代码示例

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

public HttpConnectionParams getParams() {
  if (hasConnection()) {
    return wrappedConnection.getParams();
  } else {
    throw new IllegalStateException("Connection has been released");
  }
}

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

public HttpConnection getConnectionWithTimeout(
  HostConfiguration hostConfiguration, long timeout) {
  httpConnection = new HttpConnection(hostConfiguration);
  httpConnection.setHttpConnectionManager(this);
  httpConnection.getParams().setDefaults(connectionParams);
  return httpConnection;
}

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

/**
 * Applies connection parameters specified for a given method
 * 
 * @param method HTTP method
 * 
 * @throws IOException if an I/O occurs setting connection parameters 
 */
private void applyConnectionParams(final HttpMethod method) throws IOException {
  int timeout = 0;
  // see if a timeout is given for this method
  Object param = method.getParams().getParameter(HttpMethodParams.SO_TIMEOUT);
  if (param == null) {
    // if not, use the default value
    param = this.conn.getParams().getParameter(HttpConnectionParams.SO_TIMEOUT);
  }
  if (param != null) {
    timeout = ((Integer)param).intValue();
  }
  this.conn.setSocketTimeout(timeout);                    
}

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

LOG.trace("Attempt number " + execCount + " to process request");
if (this.conn.getParams().isStaleCheckingEnabled()) {
  this.conn.closeIfStale();

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

if ((len > 0) && ("chunked".equalsIgnoreCase(encodings[len - 1].getName()))) { 
  if (conn.isResponseAvailable(conn.getParams().getSoTimeout())) {
    result = new ChunkedInputStream(is, this);
  } else {

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

int readTimeout = conn.getParams().getSoTimeout();
try {
  conn.setSocketTimeout(RESPONSE_WAIT_TIME_MS);

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

httpConnection = new HttpConnection(hostConfiguration);
  httpConnection.setHttpConnectionManager(this);
  httpConnection.getParams().setDefaults(this.params);
} else {

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

public HttpConnectionParams getParams() {
  if (hasConnection()) {
    return wrappedConnection.getParams();
  } else {
    throw new IllegalStateException("Connection has been released");
  }
}

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

public HttpConnectionParams getParams() {
  if (hasConnection()) {
    return wrappedConnection.getParams();
  } else {
    throw new IllegalStateException("Connection has been released");
  }
}

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

public HttpConnectionParams getParams() {
  if (hasConnection()) {
    return wrappedConnection.getParams();
  } else {
    throw new IllegalStateException("Connection has been released");
  }
}

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

public HttpConnectionParams getParams() {
  if (hasConnection()) {
    return wrappedConnection.getParams();
  } else {
    throw new IllegalStateException("Connection has been released");
  }
}

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

public HttpConnectionParams getParams() {
  if (hasConnection()) {
    return wrappedConnection.getParams();
  } else {
    throw new IllegalStateException("Connection has been released");
  }
}

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

public HttpConnection getConnectionWithTimeout(
  HostConfiguration hostConfiguration, long timeout) {
  httpConnection = new HttpConnection(hostConfiguration);
  httpConnection.setHttpConnectionManager(this);
  httpConnection.getParams().setDefaults(connectionParams);
  return httpConnection;
}

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

public HttpConnection getConnectionWithTimeout(
  HostConfiguration hostConfiguration, long timeout) {
  httpConnection = new HttpConnection(hostConfiguration);
  httpConnection.setHttpConnectionManager(this);
  httpConnection.getParams().setDefaults(connectionParams);
  return httpConnection;
}

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

public HttpConnection getConnectionWithTimeout(
  HostConfiguration hostConfiguration, long timeout) {
  httpConnection = new HttpConnection(hostConfiguration);
  httpConnection.setHttpConnectionManager(this);
  httpConnection.getParams().setDefaults(connectionParams);
  return httpConnection;
}

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

public HttpConnection getConnectionWithTimeout(
  HostConfiguration hostConfiguration, long timeout) {
  httpConnection = new HttpConnection(hostConfiguration);
  httpConnection.setHttpConnectionManager(this);
  httpConnection.getParams().setDefaults(connectionParams);
  return httpConnection;
}

代码示例来源:origin: iipc/webarchive-commons

public HttpConnection getConnectionWithTimeout(
  HostConfiguration hostConfiguration, long timeout) {
  HttpConnection conn = new HttpConnection(hostConfiguration);
  conn.setHttpConnectionManager(this);
  conn.getParams().setDefaults(this.getParams());
  return conn;
}

代码示例来源:origin: org.netpreserve.commons/webarchive-commons

public HttpConnection getConnectionWithTimeout(
  HostConfiguration hostConfiguration, long timeout) {
  HttpConnection conn = new HttpConnection(hostConfiguration);
  conn.setHttpConnectionManager(this);
  conn.getParams().setDefaults(this.getParams());
  return conn;
}

代码示例来源:origin: org.netpreserve.commons/commons-web

public HttpConnection getConnectionWithTimeout(
  HostConfiguration hostConfiguration, long timeout) {
  HttpConnection conn = new HttpConnection(hostConfiguration);
  conn.setHttpConnectionManager(this);
  conn.getParams().setDefaults(this.getParams());
  return conn;
}

代码示例来源:origin: org.zaproxy/zap

/**
   * Use custom {@link ZapHttpConnection} to allow for socket exposure.
   */
  @Override
  public HttpConnection getConnectionWithTimeout(
      HostConfiguration hostConfiguration, long timeout) {

    if (httpConnection == null) {
      httpConnection = new ZapHttpConnection(hostConfiguration);
      httpConnection.setHttpConnectionManager(this);
      httpConnection.getParams().setDefaults(this.getParams());
    }
    
    return super.getConnectionWithTimeout(hostConfiguration, timeout);
  }
}

相关文章

微信公众号

最新文章

更多

HttpConnection类方法