com.google.api.client.http.javanet.ConnectionFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of google-http-client Show documentation
Show all versions of google-http-client Show documentation
Google HTTP Client Library for Java. Functionality that works on all supported Java platforms,
including Java 5 (or higher) desktop (SE) and web (EE), Android, and Google App Engine.
package com.google.api.client.http.javanet;
import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.URL;
/** Given a {@link URL} instance, produces an {@link HttpURLConnection}. */
public interface ConnectionFactory {
/**
* Creates a new {@link HttpURLConnection} from the given {@code url}.
*
* @param url the URL to which the connection will be made
* @return the created connection object, which will still be in the pre-connected state
* @throws IOException if there was a problem producing the connection
* @throws ClassCastException if the URL is not for an HTTP endpoint
*/
HttpURLConnection openConnection(URL url) throws IOException, ClassCastException;
}