Package uk.ac.starlink.auth
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.
Defines how a connection is obtained from a URL.
- Since:
- 18 Jun 2020
- Author:
- Mark Taylor
-
Method Summary
Modifier and TypeMethodDescriptionvoid
connect
(HttpURLConnection hconn) Opens communication to an HTTP resource.
-
Method Details
-
connect
Opens communication to an HTTP resource. The implementation will presumably at least callURLConnection.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
-