目录

class info
public class Drive.Comments.List extends DriveRequest<CommentList>
Drive.Comments.List class.

Protected Constructor Summary

Constructor name

Drive.Comments.List(String fileId)

Constructor for the Drive.Comments.List class.

Public Method Summary

Return typeMethod name
String

getFileId()

Obtains a file ID.

Boolean

getIncludeDeleted()

Checks whether to return deleted comments.

Integer

getPageSize()

Obtains the maximum number of comments returned on each page.

String

getCursor()

Obtains the start cursor for pagination query.

String

getStartEditedTime()

Obtains the earliest modification time of a comment.

boolean

isIncludeDeleted() 

Determines whether to return deleted comments.

Drive.Comments.List

set(String parameterName, Object value)

Sets the given parameter value for the given parameter name.

Drive.Comments.List

setForm(String form) 

Sets the response data format.

Drive.Comments.List

setFields(String fields)

Sets the fields to be contained in a response.

Drive.Comments.List

setFileId(String fileId)

Sets a file ID.

Drive.Comments.List

setIncludeDeleted(Boolean includeDeleted)

Sets whether to return deleted comments.

Drive.Comments.List

setPageSize(Integer pageSize)

Sets the maximum number of comments returned on each page.

Drive.Comments.List

setCursor(String cursor)

Sets the start cursor for pagination query.

Drive.Comments.List

setPrettyPrint(Boolean prettyPrint)

Sets whether to return a response containing indentations and line-wrapping breaks.

Drive.Comments.List

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.

Drive.Comments.List

setStartEditedTime(String startEditedTime)

Set the earliest modification time of a comment.

CommentList

execute()

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

Protected Constructors

constructor
protected Drive.Comments.List(String fileId)
Constructs a Drive.Comments.List object.

Public Methods

Method
public String getFileId()
Obtains a file ID.

Return

typedesc
StringFile ID.
Method


public Boolean getIncludeDeleted()

Checks whether to return deleted comments.

Return

typedesc
BooleanIndicates whether to return deleted comments.
Method


public Integer getPageSize()

Obtains the maximum number of comments returned on each page.

Return

typedesc
IntegerMaximum number of comments returned on each page. The value ranges from 1 to 100. If pageSize is not set or the value of pageSize exceeds the maximum value set on the server, the maximum value set on the server will be used by default.
Method


public String getCursor()

Obtains the start cursor for pagination query.

Return

typedesc
StringCursor, which indicates the position of the previous query.
Method


public String getStartEditedTime()

Obtains the earliest modification time of a comment.

Return

typedesc
StringEarliest modification time of a comment.
Method


public boolean isIncludeDeleted()

Determines whether to return deleted comments.

Return

typedesc
booleanIndicates whether to return deleted comments.
Method


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

Sets the given parameter value for the given parameter name.

Parameters

Parameter nameParameter desc
parameterNameParameter name.
valueParameter value.

Return

typedesc
Drive.Comments.ListA Drive.Comments.List object.
Method


public Drive.Comments.List setForm(String form)

Sets the response data format.

Parameters

Parameter nameParameter desc
formResponse data format. The default data format is JSON, and only this format is supported currently.

Return

typedesc
Drive.Comments.ListA Drive.Comments.List object.
Method


public Drive.Comments.List setFields(String fields)

Sets the fields to be contained in a response.

Parameters

Parameter nameParameter desc
fieldsFields to be contained in a response. If all related fields need to be contained in a response, set this parameter to *. If only certain fields need to be contained in a response, set this parameter to the specific fields, for example, category, nextCursor, comments/category, comments/creator.

If fields is not set, the system returns category, comments.category, comments.creator.category, comments.id, and nextCursor by default.

Return

typedesc
Drive.Comments.ListA Drive.Comments.List object.
Method


public Drive.Comments.List setFileId(String fileId)

Sets a file ID.

Parameters

Parameter nameParameter desc
fileIdFile ID.

Return

typedesc
Drive.Comments.ListA Drive.Comments.List object.
Method


public Drive.Comments.List setIncludeDeleted(Boolean includeDeleted)

Sets whether to return deleted comments.

Parameters

Parameter nameParameter desc
includeDeletedIndicates whether to return deleted comments.

Return

typedesc
Drive.Comments.ListA Drive.Comments.List object.
Method


public Drive.Comments.List setPageSize(Integer pageSize)

Sets the maximum number of comments returned on each page.

Parameters

Parameter nameParameter desc
pageSizeMaximum number of comments returned on each page. The value ranges from 1 to 100. If pageSize is not set or the value of pageSize exceeds the maximum value set on the server, the maximum value set on the server will be used by default.

Return

typedesc
Drive.Comments.ListA Drive.Comments.List object.
Method


public Drive.Comments.List setCursor(String cursor)

Sets the start cursor for pagination query.

Parameters

Parameter nameParameter desc
cursorCursor, which is obtained from nextCursor in the previous response. The server returns a maximum of 100 comments for each query request. If there are more than 100 comments, the cursor needs to be set to nextCursor for a new comment notification. This process repeats until nextCursor in the response is empty, which indicates that all comments have been returned.

Return

typedesc
Drive.Comments.ListA Drive.Comments.List object.
Method


public Drive.Comments.List setPrettyPrint(Boolean prettyPrint)

Sets whether to return a response containing indentations and line-wrapping breaks.

Parameters

Parameter nameParameter desc
prettyPrintIndicates whether to return a response containing indentations and line-wrapping breaks. The value is a Boolean value.

Return

typedesc
Drive.Comments.ListA Drive.Comments.List object.
Method


public Drive.Comments.List 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

Parameter nameParameter desc
quotaIdA string of less than 40 characters to identify a user. The string is used by the server to restrict the user’s API calls.

Return

typedesc
Drive.Comments.ListA Drive.Comments.List object.
Method


public Drive.Comments.List setStartEditedTime(String startEditedTime)

Set the earliest modification time of a comment.

Parameters

Parameter nameParameter desc
startEditedTimeEarliest modification time of a comment.

Return

typedesc
Drive.Comments.ListA Drive.Comments.List object.
Method


public T execute() throws IOException

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

Throws

Parameter nameParameter desc
java.io.IOExceptionI/O exception thrown upon an API call failure. You can use the getMessage() method to obtain the error description.

Return

typedesc
CommentListThe Drive.Comments.List class extends DriveRequest<CommentList>. Therefore, the return result of the execute() method is encapsulated as a CommentList object.

Sample Code

  1. private void listComments(Drive drive, String fileId){
  2.    try{
  3.        CommentList list = drive.comments().list(fileId).execute();
  4.    } catch (Exception e){
  5.        Log.e(TAG, "listComments error: " + e.toString());
  6.    }
  7. }