Module bus.http
Package org.miaixz.bus.http.plugin.httpz
Class FileInterceptor.DownloadFileProgressResponseBody
java.lang.Object
org.miaixz.bus.http.bodys.ResponseBody
org.miaixz.bus.http.plugin.httpz.FileInterceptor.DownloadFileProgressResponseBody
- All Implemented Interfaces:
Closeable,AutoCloseable
- Enclosing class:
FileInterceptor
A
ResponseBody decorator that reports download progress as the body is being read.-
Constructor Summary
ConstructorsConstructorDescriptionDownloadFileProgressResponseBody(ResponseBody body, ProgressListener progressListener) Constructs a new progress-reporting response body. -
Method Summary
Modifier and TypeMethodDescriptionlongReturns the number of bytes in the response.org.miaixz.bus.core.lang.MediaTypeReturns the media type of this response body.org.miaixz.bus.core.io.source.BufferSourcesource()Returns the data source for this response body.Methods inherited from class org.miaixz.bus.http.bodys.ResponseBody
bytes, byteStream, charStream, close, create, create, create, create, string
-
Constructor Details
-
DownloadFileProgressResponseBody
Constructs a new progress-reporting response body.- Parameters:
body- The original response body to wrap.progressListener- The listener for progress updates.
-
-
Method Details
-
contentType
public org.miaixz.bus.core.lang.MediaType contentType()Description copied from class:ResponseBodyReturns the media type of this response body.- Specified by:
contentTypein classResponseBody- Returns:
- The media type, which may be null.
-
contentLength
public long contentLength()Description copied from class:ResponseBodyReturns the number of bytes in the response. This will be -1 if the size is unknown.- Specified by:
contentLengthin classResponseBody- Returns:
- The content length.
-
source
public org.miaixz.bus.core.io.source.BufferSource source()Description copied from class:ResponseBodyReturns the data source for this response body.- Specified by:
sourcein classResponseBody- Returns:
- The data source.
-