You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

HttpClientConnectionFactory.java 1.1KB

1234567891011121314151617181920212223242526272829303132333435363738
  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. import java.io.IOException;
  12. import java.net.Proxy;
  13. import java.net.URL;
  14. import org.eclipse.jgit.transport.http.HttpConnection;
  15. import org.eclipse.jgit.transport.http.HttpConnectionFactory;
  16. /**
  17. * A factory returning instances of
  18. * {@link org.eclipse.jgit.transport.http.apache.HttpClientConnection}
  19. *
  20. * @since 3.3
  21. */
  22. public class HttpClientConnectionFactory implements HttpConnectionFactory {
  23. /** {@inheritDoc} */
  24. @Override
  25. public HttpConnection create(URL url) throws IOException {
  26. return new HttpClientConnection(url.toString());
  27. }
  28. /** {@inheritDoc} */
  29. @Override
  30. public HttpConnection create(URL url, Proxy proxy)
  31. throws IOException {
  32. return new HttpClientConnection(url.toString(), proxy);
  33. }
  34. }