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) {
...
}
}
推荐阅读
