目录

Progress

Class Info

public class Progress

文件上传/下载任务执行过程相关信息实体类。

Public Constructor Summary

Constructor Name

public Progress(Request request, String url, int progress, long totalSize, long finishedSize, long speed)

使用已有参数,构造Progress对象。

Public Method Summary

Qualifier and Type

Method Name and Description

public long

getFinishedSize()

获取当前已上传/下载的文件大小,单位:Byte。

public int

getProgress()

获取当前请求进度,范围:[0, 100]。

public Request

getRequest()

获取请求对象。

public long

getSpeed()

获取实时文件上传/下载的速度,单位:Byte/s。

public long

getTotalSize()

获取整个文件的大小,单位:Byte。

public String

getUrl()

获取请求URL。

Public Constructors

[h2]Progress

Constructor

public Progress(Request request, String url, int progress, long totalSize, long finishedSize, long speed)

使用已有参数,构造Progress对象。

Parameters

Name

Description

request

Request对象。

url

请求连接。

progress

请求进度,范围:[0, 100]。

totalSize

文件总大小,单位:Byte。

finishedSize

已上传/下载文件大小,单位:Byte。

speed

实时速度,单位:Byte/s。

Public Methods

[h2]getFinishedSize

Method

public long getFinishedSize()

获取当前已上传/下载的文件大小,单位:Byte。

Returns

Type

Description

long

已上传/下载的文件大小,单位:Byte。

[h2]getProgress

Method

public int getProgress()

获取当前请求进度,范围:[0, 100]。

Returns

Type

Description

int

当前文件上传/下载的进度,范围:[0, 100]。

[h2]getRequest

Method

public Request getRequest()

获取请求对象。

Returns

Type

Description

Request

请求的对象。

[h2]getSpeed

Method

public long getSpeed()

获取实时文件上传/下载的速度,单位:Byte/s。

Returns

Type

Description

long

实时速度,单位:Byte/s。

[h2]getTotalSize

Method

public long getTotalSize()

获取整个文件的大小。

Returns

Type

Description

long

整个文件的大小,单位:Byte。

[h2]getUrl

Method

public String getUrl()

获取请求URL。

Returns

Type

Description

String

请求URL。