Class MonitoredHttpResponseContentInputStream
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
java.io.BufferedInputStream
org.apache.commons.vfs2.util.MonitorInputStream
org.apache.commons.vfs2.provider.http4.MonitoredHttpResponseContentInputStream
- All Implemented Interfaces:
Closeable
,AutoCloseable
An InputStream that cleans up the
org.apache.http.client.methods.CloseableHttpResponse
on close.-
Field Summary
FieldsFields inherited from class java.io.FilterInputStream
in
-
Constructor Summary
ConstructorsConstructorDescriptionMonitoredHttpResponseContentInputStream
(org.apache.http.HttpResponse httpResponse) MonitoredHttpResponseContentInputStream
(org.apache.http.HttpResponse httpResponse, int bufferSize) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Prevent closing the stream itself if the httpResponse is closeable.protected void
onClose()
Called after the stream has been closed.Methods inherited from class org.apache.commons.vfs2.util.MonitorInputStream
available, close, getCount, read, read
Methods inherited from class java.io.BufferedInputStream
mark, markSupported, reset, skip
Methods inherited from class java.io.FilterInputStream
read
-
Field Details
-
httpResponse
private final org.apache.http.HttpResponse httpResponse
-
-
Constructor Details
-
MonitoredHttpResponseContentInputStream
public MonitoredHttpResponseContentInputStream(org.apache.http.HttpResponse httpResponse) throws IOException - Throws:
IOException
-
MonitoredHttpResponseContentInputStream
public MonitoredHttpResponseContentInputStream(org.apache.http.HttpResponse httpResponse, int bufferSize) throws IOException - Throws:
IOException
-
-
Method Details
-
closeSuper
Prevent closing the stream itself if the httpResponse is closeable. Closing the stream may consume all remaining data no matter how large (VFS-805).- Overrides:
closeSuper
in classMonitorInputStream
- Throws:
IOException
- if an IO error occurs.
-
onClose
Description copied from class:MonitorInputStream
Called after the stream has been closed. This implementation does nothing.- Overrides:
onClose
in classMonitorInputStream
- Throws:
IOException
- if an error occurs.
-