目录

Drive.Changes.List

Class Info

public class Drive.Changes. List extends DriveRequest<ChangeList>

Drive.Changes.List类结构。

Protected Constructor Summary

Constructor Name

Drive.Changes.List(String cursor)

Drive.Changes.List构造方法。

Public Method Summary

Qualifier and Type

Method Name and Description

ChangeList

execute()

发送HTTP请求,返回要转换的对象。

String

getContainers()

获取用户要查询存储空间的类型。

String

getCursor()

获取cursor,cursor为分页游标,由前一个响应的nextCursor获取或者从getStartCursor方法获取。

Boolean

getIncludeDeleted()

获取是否包括已从更改列表中删除的项目更改,例如通过删除或失去访问权限。

Integer

getPageSize()

获取pageSize,pageSize为每次分页查询请求返回的changes列表数量,默认值是100,可接受值1-100,注意在到达最后的列表之前,实际有可能返回部分或者空结果。

boolean

isIncludeDeleted()

获取设置的IncludeDeleted参数转换值。

Drive.Changes.List

set(String parameterName, Object value)

设置其他参数名称和参数值。

Drive.Changes.List

setContainers(String containers)

设置用户要查询存储空间的类型。

Drive.Changes.List

setCursor(String cursor)

设置cursor,cursor为分页游标,由前一个响应的nextCursor获取或者从getStartCursor方法获取。

Drive.Changes.List

setFields(String fields)

设置希望在响应中包含的字段。

Drive.Changes.List

setForm(String form)

设置响应的数据格式。

Drive.Changes.List

setIncludeDeleted(Boolean includeDeleted)

设置是否包括已从更改列表中删除的项目更改,例如通过删除或失去访问权限。

Drive.Changes.List

setPageSize(Integer pageSize)

设置pageSize,pageSize为每次分页查询请求返回的changes列表数量,默认值是100,可接受值1-100,注意在到达最后的列表之前,实际有可能返回部分或者空结果。

Drive.Changes.List

setPrettyPrint(Boolean prettyPrint)

设置返回带有缩进和换行符的响应(格式化,便于阅读打印)。

Drive.Changes.List

setQuotaId(String quotaId)

设置一个不超过40字符的字符串,用于代表用户,主要用于服务端基于用户限制单个用户的API访问数量,用做API访问量配额控制。

Protected Constructors

[h2]Drive.Changes.List

Constructor

protected Drive.Changes.List(String cursor)

Drive.Changes.List构造方法。

Parameters

Name

Description

cursor

分页游标,由前一个响应的nextCursor获取或者从getStartCursor方法获取;由于每次查询请求,服务器返回的changes列表数量至多为100个,如果本次待返回的数量大于100,则需要设置cursor,用以指定下一次查询的分页游标,再次进行遍历查询请求,直至响应结果中的nextCursor为空,才能获取到所有待查询的changes列表信息。

Public Methods

[h2]setFields

Method

public Drive.Changes.List setFields(String fields)

设置希望在响应中包含的字段。说明:fields填*时,drive#file 结构中sharer、sharedWithMeTime、hasShared、capabilities、permissions、permissionIds不返回。

Parameters

Name

Description

fields

取值范围为响应结果中的字段,如果希望在响应中包含所有字段,支持*匹配所有字段;如果希望仅返回某些特定字段,则设置需要返回的字段名即可,示例如下:"category、 nextCursor、 newStartCursor、changes/category、changes/changeType"。

若不设置fields,则默认返回:“category、 changes.fileName、changes.time、 newStartCursor、 nextCursor”。

Returns

Type

Description

Drive.Changes.List

返回一个Drive.Changes.List类对象。

[h2]set

Method

public Drive.Changes.List set(String parameterName, Object value)

设置其他参数名称和参数值。

Parameters

Name

Description

parameterName

参数名称。

value

参数值。

Returns

Type

Description

Drive.Changes.List

返回一个Drive.Changes.List类对象。

[h2]getCursor

Method

public String getCursor()

获取cursor。

Returns

Type

Description

String

返回cursor。

[h2]setCursor

Method

public Drive.Changes.List setCursor(String cursor)

设置cursor。

Parameters

Name

Description

cursor

分页游标,由前一个响应的nextCursor获取或者从getStartCursor方法获取;由于每次查询请求,服务器返回的changes列表数量至多为100个,如果本次待返回的数量大于100,则需要设置cursor,用以指定下一次查询的分页游标,再次进行遍历查询请求,直至响应结果中的nextCursor为空,才能获取到所有待查询的changes列表信息。

Returns

Type

Description

Drive.Changes.List

返回一个Drive.Changes.List类对象。

[h2]getPageSize

Method

public Integer getPageSize()

获取pageSize。

Returns

Type

Description

Integer

返回pageSize大小。

[h2]setPageSize

Method

public Drive.Changes.List setPageSize(Integer pageSize)

设置pageSize。

Parameters

Name

Description

pageSize

指定每次分页查询请求返回的changes列表数量,默认值是100,可接受值1-100,注意在到达最后的列表之前,实际有可能返回部分或者空结果。

Returns

Type

Description

Drive.Changes.List

返回一个Drive.Changes.List类对象。

[h2]getContainers

Method

public String getContainers()

获取用户要查询存储空间的类型。

Returns

Type

Description

String

用户要查询存储空间的类型。支持的值是:'drive'和'applicationData'。

[h2]setContainers

Method

public Drive.Changes.List setContainers(String containers)

设置用户要查询存储空间的类型。

Parameters

Name

Description

containers

用户要查询存储空间的类型。支持的值是“drive”和“applicationData”。

Returns

Type

Description

Drive.Changes.List

返回一个Drive.Changes.List类对象。

[h2]setForm

Method

public Drive.Changes.List setForm(String form)

设置响应的数据格式。

Parameters

Name

Description

form

响应的数据格式,默认为json,只支持json。

Returns

Type

Description

Drive.Changes.List

返回一个Drive.Changes.List类对象。

[h2]setPrettyPrint

Method

public Drive.Changes.List setPrettyPrint(Boolean prettyPrint)

设置返回带有缩进和换行符的响应(格式化,便于阅读打印)。

Parameters

Name

Description

prettyPrint

布尔值,标识响应是否带有缩进和换行符。

Returns

Type

Description

Drive.Changes.List

返回一个Drive.Changes.List类对象。

[h2]setQuotaId

Method

public Drive.Changes.List setQuotaId(String quotaId)

设置一个不超过40字符的字符串,用于代表用户,主要用于服务端基于用户限制单个用户的API访问数量,用做API访问量配额控制。

Parameters

Name

Description

quotaId

一个不超过40字符的字符串,用于代表用户,主要用于服务端基于用户限制单个用户的API访问数量,用做API访问量配额控制。

Returns

Type

Description

Drive.Changes.List

返回一个Drive.Changes.List类对象。

[h2]getIncludeDeleted

Method

public Boolean getIncludeDeleted()

获取是否包含已从更改列表中删除的项目更改,例如通过删除或失去访问权限。[default: true]。

Returns

Type

Description

Boolean

返回是否包含已从更改列表中删除的项目更改,例如通过删除或失去访问权限。[default: true]。

[h2]setIncludeDeleted

Method

public Drive.Changes.List setIncludeDeleted(Boolean includeDeleted)

设置是否包括已从更改列表中删除的项目更改,例如通过删除或失去访问权限。

Parameters

Name

Description

includeDeleted

是否包括已从更改列表中删除的项目更改,例如通过删除或失去访问权限。

Returns

Type

Description

Drive.Changes.List

返回一个Drive.Changes.List类对象。

[h2]isIncludeDeleted

Method

public boolean isIncludeDeleted()

是否设置IncludeDeleted参数转换值。

Returns

Type

Description

boolean

是否设置IncludeDeleted参数转换值。

[h2]execute

Method

public T execute() throws IOException

发送HTTP请求,返回要转换的对象。

Throws

Name

Description

java.io.IOException

若接口调用异常,会返回IOException。您可以通过getMessage方法获取错误描述。

Returns

Type

Description

ChangeList

Drive.Changes.List类继承自DriveRequest<ChangeList>。调用execute方法返回,返回结果封装为ChangeList对象。

Sample Code

private void listChange (Drive drive, String cursor){
    try{
        Drive.Changes.List listRequest = drive.changes().list(cursor);
        ChangeList changeList = listRequest.execute();
    } catch (Exception e){
        Log.e(TAG, "listChange error: " + e.getMessage());
    }
}