目录

Drive.Comments.Get

Class Info

public class Drive.Comments.Get extends DriveRequest<Comment>

Drive.Comments.Get类结构。

Protected Constructor Summary

Constructor Name

Drive.Comments.Get(String fileId, String commentId)

Drive.Comments.Get构造方法。

Public Method Summary

Qualifier and Type

Method Name and Description

String

getCommentId()

获取文件评论的ID。

String

getFileId()

获取文件ID。

Boolean

getIncludeDeleted()

获取是否返回删除的评论。

boolean

isIncludeDeleted()

获取是否返回删除的评论。

Drive.Comments.Get

set(String parameterName, Object value)

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

Drive.Comments.Get

setCommentId(String commentId)

设置文件评论的ID。

Drive.Comments.Get

setFileId(String fileId)

设置文件ID。

Drive.Comments.Get

setFields(String fields)

设置希望在响应中包含的字段。说明:fields填*时,drive#comments 结构中replies不返回。

Drive.Comments.Get

setForm(String form)

设置响应的数据格式。

Drive.Comments.Get

setIncludeDeleted(Boolean includeDeleted)

设置是否返回删除的评论。

Drive.Comments.Get

setPrettyPrint(Boolean prettyPrint)

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

Drive.Comments.Get

setQuotaId(String quotaId)

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

Protected Constructors

[h2]Drive.Comments.Get

Constructor

protected Drive.Comments.Get(String fileId, String commentId)

Drive.Comments.Get构造方法。

Parameters

Name

Description

fileId

文件ID。

commentId

文件评论的ID。

Public Methods

[h2]getCommentId

Method

public String getCommentId()

获取文件评论的ID。

Returns

Type

Description

String

文件评论的ID。

[h2]getFileId

Method

public String getFileId()

获取文件ID。

Returns

Type

Description

String

文件ID。

[h2]getIncludeDeleted

Method

public Boolean getIncludeDeleted()

获取是否返回删除的评论。

Returns

Type

Description

Boolean

是否返回删除的评论。

[h2]isIncludeDeleted

Method

public boolean isIncludeDeleted()

获取是否返回删除的评论。

Returns

Type

Description

boolean

是否返回删除的评论。

[h2]set

Method

public Drive.Comments.Get set(String parameterName, Object value)

设置自定义参数名称和参数值。

Parameters

Name

Description

parameterName

参数名称。

value

参数值。

Returns

Type

Description

Drive.Comments.Get

返回一个Drive.Comments.Get类对象。

[h2]setForm

Method

public Drive.Comments.Get setForm(String form)

设置响应的数据格式。

Parameters

Name

Description

form

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

Returns

Type

Description

Drive.Comments.Get

返回一个Drive.Comments.Get类对象。

[h2]setCommentId

Method

public Drive.Comments.Get setCommentId(String commentId)

设置文件评论的ID。

Parameters

Name

Description

commentId

文件评论的ID。

Returns

Type

Description

Drive.Comments.Get

返回一个Drive.Comments.Get类对象。

[h2]setFields

Method

public Drive.Comments.Get setFields(String fields)

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

Parameters

Name

Description

fields

希望在响应中包含的字段,如果希望在响应中包含所有字段,支持*匹配所有字段;

Returns

Type

Description

Drive.Comments.Get

返回一个Drive.Comments.Get类对象。

[h2]setFileId

Method

public Drive.Comments.Get setFileId(String fileId)

设置文件ID。

Parameters

Name

Description

fileId

文件ID。

Returns

Type

Description

Drive.Comments.Get

返回一个Drive.Comments.Get类对象。

[h2]setIncludeDeleted

Method

public Drive.Comments.Get setIncludeDeleted(Boolean includeDeleted)

设置是否返回删除的评论。

Parameters

Name

Description

includeDeleted

是否返回删除的评论。

Returns

Type

Description

Drive.Comments.Get

返回一个Drive.Comments.Get类对象。

[h2]setPrettyPrint

Method

public Drive.Comments.Get setPrettyPrint(Boolean prettyPrint)

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

Parameters

Name

Description

prettyPrint

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

Returns

Type

Description

Drive.Comments.Get

返回一个Drive.Comments.Get类对象。

[h2]setQuotaId

Method

public Drive.Comments.Get setQuotaId(String quotaId)

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

Parameters

Name

Description

quotaId

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

Returns

Type

Description

Drive.Comments.Get

返回一个Drive.Comments.Get类对象。

[h2]execute

Method

public T execute() throws IOException

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

Throws

Name

Description

java.io.IOException

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

Returns

Type

Description

Comment

Drive.Comments.Get类继承自DriveRequest<Comment>。调用execute方法返回,返回结果封装为Comment对象,返回的结果仅包含fields指定的属性。

Sample Code

private void getComments(Drive drive, String fileId, String commentId){
    try{
        Comment mComment = drive.comments().get(fileId, commentId).execute();
    } catch (Exception e){
        Log.e(TAG, "getComments error: " + e.getMessage());
    }
}