目录

Drive.Comments.Get

Class Info

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

Drive.Comments.Get class.

Protected Constructor Summary

Constructor Name

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

Constructs a Drive.Comments.Get object.

Public Method Summary

Qualifier and Type

Method Name and Description

String

getCommentId()

Obtains a file comment ID.

String

getFileId()

Obtains a file ID.

Boolean

getIncludeDeleted()

Checks whether to return deleted comments.

boolean

isIncludeDeleted()

Checks whether to return deleted comments.

Drive.Comments.Get

set(String parameterName, Object value)

Sets the given parameter value for the given parameter name.

Drive.Comments.Get

setForm(String form)

Sets the response data format.

Drive.Comments.Get

setCommentId(String commentId)

Sets a file comment ID.

Drive.Comments.Get

setFields(String fields)

Sets the fields to be contained in a response. Note: If fields is set to *, replies in drive#comments is not returned.

Drive.Comments.Get

setFileId(String fileId)

Sets a file ID.

Drive.Comments.Get

setIncludeDeleted(Boolean includeDeleted)

Sets whether to return deleted comments.

Drive.Comments.Get

setPrettyPrint(Boolean prettyPrint)

Sets whether to return a response containing indentations and newline characters.

Drive.Comments.Get

setQuotaId(String quotaId)

Sets a string of less than 40 characters to identify a user. The string is used by the server to restrict the user's API calls.

Comment

execute()

Sends an HTTP request and returns the object to be converted.

Protected Constructors

[h2]Drive.Comments.Get

Constructor

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

Constructs a Drive.Comments.Get object.

Parameters

Name

Description

fileId

File ID.

commentId

Comment ID.

Public Methods

[h2]getCommentId

Method

public String getCommentId()

Obtains a file comment ID.

Returns

Type

Description

String

Comment ID.

[h2]getFileId

Method

public String getFileId()

Obtains a file ID.

Returns

Type

Description

String

File ID.

[h2]getIncludeDeleted

Method

public Boolean getIncludeDeleted()

Checks whether to return deleted comments.

Returns

Type

Description

Boolean

Whether to return deleted comments.

[h2]isIncludeDeleted

Method

public boolean isIncludeDeleted()

Checks whether to return deleted comments.

Returns

Type

Description

boolean

Whether to return deleted comments.

[h2]set

Method

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

Sets the given parameter value for the given parameter name.

Parameters

Name

Description

parameterName

Parameter name.

value

Parameter value.

Returns

Type

Description

Drive.Comments.Get

A Drive.Comments.Get object.

[h2]setForm

Method

public Drive.Comments.Get setForm(String form)

Sets the response data format.

Parameters

Name

Description

form

Response data format. The default data format is json, and only this format is supported currently.

Returns

Type

Description

Drive.Comments.Get

A Drive.Comments.Get object.

[h2]setCommentId

Method

public Drive.Comments.Get setCommentId(String commentId)

Sets a file comment ID.

Parameters

Name

Description

commentId

Comment ID.

Returns

Type

Description

Drive.Comments.Get

A Drive.Comments.Get object.

[h2]setFields

Method

public Drive.Comments.Get setFields(String fields)

Sets the fields to be contained in a response.

Parameters

Name

Description

fields

Fields to be contained in a response. If all related fields need to be contained in a response, set this parameter to asterisk (*).

Returns

Type

Description

Drive.Comments.Get

A Drive.Comments.Get object.

[h2]setFileId

Method

public Drive.Comments.Get setFileId(String fileId)

Sets a file ID.

Parameters

Name

Description

fileId

File ID.

Returns

Type

Description

Drive.Comments.Get

A Drive.Comments.Get object.

[h2]setIncludeDeleted

Method

public Drive.Comments.Get setIncludeDeleted(Boolean includeDeleted)

Sets whether to return deleted comments.

Parameters

Name

Description

includeDeleted

Indicates whether to return deleted comments.

Returns

Type

Description

Drive.Comments.Get

A Drive.Comments.Get object.

[h2]setPrettyPrint

Method

public Drive.Comments.Get setPrettyPrint(Boolean prettyPrint)

Sets whether to return a response containing indentations and newline characters.

Parameters

Name

Description

prettyPrint

Indicates whether to return a response containing indentations and newline characters. The value is a Boolean value.

Returns

Type

Description

Drive.Comments.Get

A Drive.Comments.Get object.

[h2]setQuotaId

Method

public Drive.Comments.Get setQuotaId(String quotaId)

Sets a string of less than 40 characters to identify a user. The string is used by the server to restrict the user's API calls.

Parameters

Name

Description

quotaId

A string of less than 40 characters to identify a user. The string is used by the server to restrict the user's API calls.

Returns

Type

Description

Drive.Comments.Get

A Drive.Comments.Get object.

[h2]execute

Method

public T execute() throws IOException

Sends an HTTP request and returns the object to be converted.

Throws

Name

Description

java.io.IOException

I/O exception thrown upon an API call failure. You can use the getMessage method to obtain the error description.

Returns

Type

Description

Comment

The Drive.Comments.Get class inherits DriveRequest<Comment>. Therefore, the return result of the execute() method is encapsulated as a Comment object. The return result contains only the attributes specified by 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());
    }
}