Example usage for org.apache.commons.httpclient HttpConnectionManager setParams

List of usage examples for org.apache.commons.httpclient HttpConnectionManager setParams

Introduction

In this page you can find the example usage for org.apache.commons.httpclient HttpConnectionManager setParams.

Prototype

public abstract void setParams(HttpConnectionManagerParams paramHttpConnectionManagerParams);

Source Link

Usage

From source file:webdav.ManageWebDAV.java

public void connectWebDAVServer(String strUri, int intMaxConnections, String strUserId, String strPassword) {
    HostConfiguration hostConfig = new HostConfiguration();
    hostConfig.setHost(strUri);// ww w . j a  v  a 2 s  . c om

    HttpConnectionManager connectionManager = new MultiThreadedHttpConnectionManager();
    HttpConnectionManagerParams params = new HttpConnectionManagerParams();
    params.setMaxConnectionsPerHost(hostConfig, intMaxConnections);
    connectionManager.setParams(params);

    this.client = new HttpClient(connectionManager);
    client.setHostConfiguration(hostConfig);
    Credentials creds = new UsernamePasswordCredentials(strUserId, strPassword);
    client.getState().setCredentials(AuthScope.ANY, creds);
}