View Javadoc
1   /*
2    * Copyright (C) 2013 Christian Halstrick <christian.halstrick@sap.com> and others
3    *
4    * This program and the accompanying materials are made available under the
5    * terms of the Eclipse Distribution License v. 1.0 which is available at
6    * https://www.eclipse.org/org/documents/edl-v10.php.
7    *
8    * SPDX-License-Identifier: BSD-3-Clause
9    */
10  package org.eclipse.jgit.transport.http.apache;
11  
12  import java.io.IOException;
13  import java.net.Proxy;
14  import java.net.URL;
15  
16  import org.eclipse.jgit.transport.http.HttpConnection;
17  import org.eclipse.jgit.transport.http.HttpConnectionFactory;
18  
19  /**
20   * A factory returning instances of
21   * {@link org.eclipse.jgit.transport.http.apache.HttpClientConnection}
22   *
23   * @since 3.3
24   */
25  public class HttpClientConnectionFactory implements HttpConnectionFactory {
26  	/** {@inheritDoc} */
27  	@Override
28  	public HttpConnection create(URL url) throws IOException {
29  		return new HttpClientConnection(url.toString());
30  	}
31  
32  	/** {@inheritDoc} */
33  	@Override
34  	public HttpConnection create(URL url, Proxy proxy)
35  			throws IOException {
36  		return new HttpClientConnection(url.toString(), proxy);
37  	}
38  }