Package net.adoptopenjdk.icedteaweb.http
Class CloseableHttpConnection
- java.lang.Object
-
- net.adoptopenjdk.icedteaweb.http.CloseableConnection
-
- net.adoptopenjdk.icedteaweb.http.CloseableHttpConnection
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
public class CloseableHttpConnection extends CloseableConnection
Closeablewrapper around aHttpURLConnection.Only the needed methods of HttpURLConnection are exposed.
Closing the connection will trigger a disconnect on the underlying HttpUrlConnection
-
-
Field Summary
Fields Modifier and Type Field Description private java.net.HttpURLConnectiondelegate
-
Constructor Summary
Constructors Constructor Description CloseableHttpConnection(java.net.HttpURLConnection delegate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()triggersHttpURLConnection.disconnect().intgetResponseCode()delegates toHttpURLConnection.getResponseCode()-
Methods inherited from class net.adoptopenjdk.icedteaweb.http.CloseableConnection
getContentLength, getHeaderField, getHeaderFields, getInputStream, getLastModified, getLocationHeaderFieldUrl, getPermission, getURL, setConnectTimeout
-
-
-
-
Method Detail
-
close
public void close()
triggersHttpURLConnection.disconnect().- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classCloseableConnection
-
getResponseCode
public int getResponseCode() throws java.io.IOExceptiondelegates toHttpURLConnection.getResponseCode()- Overrides:
getResponseCodein classCloseableConnection- Throws:
java.io.IOException
-
-