用户登录
用户注册

分享至

Groovy 监控 HttpClient 上传进度

  • 作者: 迷茫居士71979789
  • 来源: 51数据库
  • 2022-08-17
/**
 * A utility that contains all of the client functionality needed to perform the upload tasks.  
 * This class is observable on the upload progress.
 *
 * @author Brock Heinz
 */
class ClientUtility extends Observable {

  /**
   * Wrapper around observable
   *
   * @param totalBytesWritten - number of bytes written to a stream to the server
   */
  void fireUploadProgress(int totalBytesWritten) {
    setChanged()
    notifyObservers(totalBytesWritten)
  }

  def doUpload(File f) {
    ...
  }
}
软件
前端设计
程序设计
Java相关