src/java/fr/jayasoft/ivy/repository/vfs/IvyWebdavClientFactory.java
/***********************************************************************************************
	 * Creates a new connection to the server.
	 */
Creates a new connection to the server.
Creates a new connection to the server .
public static HttpClient createConnection(String hostname, int port, String username,
			String password, FileSystemOptions fileSystemOptions) throws FileSystemException {
		HttpClient client;
		try {
			final HttpURL url = new HttpURL(username, password, hostname, port, "/");
			WebdavResource resource = new WebdavResource() {
			};
			if (fileSystemOptions != null) {
				String proxyHost = WebdavFileSystemConfigBuilder.getInstance().getProxyHost(
						fileSystemOptions);
				int proxyPort = WebdavFileSystemConfigBuilder.getInstance().getProxyPort(
						fileSystemOptions);
				if (proxyHost != null && proxyPort > 0) {
					resource.setProxy(proxyHost, proxyPort);
				}
			}
			/*
			 * if (resource == null) { resource = new WebdavResource(url); }
			 * resource.setProperties(WebdavResource.NOACTION, 1);
			 */
			resource.setHttpURL(url, WebdavResource.NOACTION, 1);
			client = resource.retrieveSessionInstance();
			HttpClientHandler handler = new HttpClientHandler();
			int httpClientVersion = handler.getHttpClientMajorVersion();
			if (httpClientVersion == 2) {
				client.setHttpConnectionManager(new WebdavConnectionManager());
			} else {
				client.setHttpConnectionManager(new IvyWebdavConnectionManager());
			}
		} catch (final IOException e) {
			throw new FileSystemException("vfs.provider.webdav/connect.error", hostname, e);
		}
		return client;
	}
public static HttpClient createConnection ( String hostname , int port , String username , String password , FileSystemOptions fileSystemOptions ) throws FileSystemException { HttpClient client ; try { final HttpURL url = new HttpURL ( username , password , hostname , port , "/" ) ; WebdavResource resource = new WebdavResource ( ) { } ; if ( fileSystemOptions != null ) { String proxyHost = WebdavFileSystemConfigBuilder . getInstance ( ) . getProxyHost ( fileSystemOptions ) ; int proxyPort = WebdavFileSystemConfigBuilder . getInstance ( ) . getProxyPort ( fileSystemOptions ) ; if ( proxyHost != null && proxyPort > 0 ) { resource . setProxy ( proxyHost , proxyPort ) ; } } /*
			 * if (resource == null) { resource = new WebdavResource(url); }
			 * resource.setProperties(WebdavResource.NOACTION, 1);
			 */ resource . setHttpURL ( url , WebdavResource . NOACTION , 1 ) ; client = resource . retrieveSessionInstance ( ) ; HttpClientHandler handler = new HttpClientHandler ( ) ; int httpClientVersion = handler . getHttpClientMajorVersion ( ) ; if ( httpClientVersion == 2 ) { client . setHttpConnectionManager ( new WebdavConnectionManager ( ) ) ; } else { client . setHttpConnectionManager ( new IvyWebdavConnectionManager ( ) ) ; } } catch ( final IOException e ) { throw new FileSystemException ( "vfs.provider.webdav/connect.error" , hostname , e ) ; } return client ; }
Creates a new connection to the server.
Creates a new connection to the server .
// Create an Http client
 // WebdavResource resource = null;
 // resource = new WebdavResource(url, proxyHost, proxyPort);
 // VFS only supports httpclient v2 for now...
