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 voidPrevent closing the stream itself if the httpResponse is closeable.protected voidonClose()Called after the stream has been closed.Methods inherited from class org.apache.commons.vfs2.util.MonitorInputStream
available, close, getCount, read, readMethods inherited from class java.io.BufferedInputStream
mark, markSupported, reset, skipMethods 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:
closeSuperin classMonitorInputStream- Throws:
IOException- if an IO error occurs.
-
onClose
Description copied from class:MonitorInputStreamCalled after the stream has been closed. This implementation does nothing.- Overrides:
onClosein classMonitorInputStream- Throws:
IOException- if an error occurs.
-