Interface UrlConnector

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface UrlConnector
Defines how a connection is obtained from a URL.
Since:
18 Jun 2020
Author:
Mark Taylor
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Opens communication to an HTTP resource.
  • Method Details

    • connect

      void connect(HttpURLConnection hconn) throws IOException
      Opens communication to an HTTP resource. The implementation will presumably at least call URLConnection.connect(), but it may optionally perform other actions as well, such as configuring the request headers as required and writing to the connection's output stream, before returning.

      If this object is being used with AuthManager, it will typically be a good idea to call setInstanceFollowRedirects(false), since redirection can be handled by AuthManager.

      Parameters:
      hconn - URL connection; on entry connect() has not yet been called, but on exit it has
      Throws:
      IOException