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:
java.io.Closeable
,java.lang.AutoCloseable
final class MonitoredHttpResponseContentInputStream extends MonitorInputStream
An InputStream that cleans up theorg.apache.http.client.methods.CloseableHttpResponse
on close.
-
-
Field Summary
Fields Modifier and Type Field Description private org.apache.http.HttpResponse
httpResponse
-
Constructor Summary
Constructors Constructor Description MonitoredHttpResponseContentInputStream(org.apache.http.HttpResponse httpResponse)
MonitoredHttpResponseContentInputStream(org.apache.http.HttpResponse httpResponse, int bufferSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
closeSuper()
Prevent closing the stream itself if the httpResponse is closeable.protected void
onClose()
Called after the stream has been closed.
-
-
-
Constructor Detail
-
MonitoredHttpResponseContentInputStream
public MonitoredHttpResponseContentInputStream(org.apache.http.HttpResponse httpResponse) throws java.io.IOException
- Throws:
java.io.IOException
-
MonitoredHttpResponseContentInputStream
public MonitoredHttpResponseContentInputStream(org.apache.http.HttpResponse httpResponse, int bufferSize) throws java.io.IOException
- Throws:
java.io.IOException
-
-
Method Detail
-
closeSuper
protected void closeSuper() throws java.io.IOException
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:
java.io.IOException
- if an IO error occurs.
-
onClose
protected void onClose() throws java.io.IOException
Description copied from class:MonitorInputStream
Called after the stream has been closed. This implementation does nothing.- Overrides:
onClose
in classMonitorInputStream
- Throws:
java.io.IOException
- if an error occurs.
-
-