Interface ConnectionFactory

  • All Known Implementing Classes:
    DefaultConnectionFactory

    public interface ConnectionFactory
    Given a URL instance, produces an HttpURLConnection.
    • Method Detail

      • openConnection

        java.net.HttpURLConnection openConnection​(java.net.URL url)
                                           throws java.io.IOException,
                                                  java.lang.ClassCastException
        Creates a new HttpURLConnection from the given url.
        Parameters:
        url - the URL to which the conneciton will be made
        Returns:
        the created connection object, which will still be in the pre-connected state
        Throws:
        java.io.IOException - if there was a problem producing the connection
        java.lang.ClassCastException - if the URL is not for an HTTP endpoint