Class CloseableHttpConnection
java.lang.Object
net.adoptopenjdk.icedteaweb.http.CloseableConnection
net.adoptopenjdk.icedteaweb.http.CloseableHttpConnection
- All Implemented Interfaces:
Closeable, AutoCloseable
Closeable wrapper around a HttpURLConnection.
Only the needed methods of HttpURLConnection are exposed.
Closing the connection will trigger a disconnect on the underlying HttpUrlConnection
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()triggersHttpURLConnection.disconnect().intdelegates toHttpURLConnection.getResponseCode()Methods inherited from class CloseableConnection
getContentLength, getHeaderField, getHeaderFields, getInputStream, getLastModified, getLocationHeaderFieldUrl, getPermission, getURL, setConnectTimeout
-
Field Details
-
delegate
-
-
Constructor Details
-
CloseableHttpConnection
CloseableHttpConnection(HttpURLConnection delegate)
-
-
Method Details
-
close
public void close()triggersHttpURLConnection.disconnect().- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classCloseableConnection
-
getResponseCode
delegates toHttpURLConnection.getResponseCode()- Overrides:
getResponseCodein classCloseableConnection- Throws:
IOException
-