Module bus.http

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

public static class FileInterceptor.DownloadFileProgressResponseBody extends ResponseBody
A ResponseBody decorator that reports download progress as the body is being read.
  • Constructor Details

    • DownloadFileProgressResponseBody

      public DownloadFileProgressResponseBody(ResponseBody body, ProgressListener progressListener)
      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: ResponseBody
      Returns the media type of this response body.
      Specified by:
      contentType in class ResponseBody
      Returns:
      The media type, which may be null.
    • contentLength

      public long contentLength()
      Description copied from class: ResponseBody
      Returns the number of bytes in the response. This will be -1 if the size is unknown.
      Specified by:
      contentLength in class ResponseBody
      Returns:
      The content length.
    • source

      public org.miaixz.bus.core.io.source.BufferSource source()
      Description copied from class: ResponseBody
      Returns the data source for this response body.
      Specified by:
      source in class ResponseBody
      Returns:
      The data source.