| class info |
| public class Drive.Comments.List extends DriveRequest<CommentList> |
| Drive.Comments.List class. |
| Constructor name |
Drive.Comments.List(String fileId) Constructor for the Drive.Comments.List class. |
| Return type | Method 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. |
| constructor |
| protected Drive.Comments.List(String fileId) |
| Constructs a Drive.Comments.List object. |
| Method |
| public String getFileId() |
| Obtains a file ID. |
Return
| type | desc |
| String | File ID. |
| Method |
public Boolean getIncludeDeleted() |
| Checks whether to return deleted comments. |
Return
| type | desc |
| Boolean | Indicates whether to return deleted comments. |
| Method |
public Integer getPageSize() |
| Obtains the maximum number of comments returned on each page. |
Return
| type | desc |
| Integer | Maximum 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
| type | desc |
| String | Cursor, which indicates the position of the previous query. |
| Method |
public String getStartEditedTime() |
| Obtains the earliest modification time of a comment. |
Return
| type | desc |
| String | Earliest modification time of a comment. |
| Method |
public boolean isIncludeDeleted() |
| Determines whether to return deleted comments. |
Return
| type | desc |
| boolean | Indicates 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 name | Parameter desc |
| parameterName | Parameter name. |
| value | Parameter value. |
Return
| type | desc |
| Drive.Comments.List | A Drive.Comments.List object. |
| Method |
public Drive.Comments.List setForm(String form) |
| Sets the response data format. |
Parameters
| Parameter name | Parameter desc |
| form | Response data format. The default data format is JSON, and only this format is supported currently. |
Return
| type | desc |
| Drive.Comments.List | A Drive.Comments.List object. |
| Method |
public Drive.Comments.List setFields(String fields) |
| Sets the fields to be contained in a response. |
Parameters
| Parameter name | Parameter desc |
| fields | Fields 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
| type | desc |
| Drive.Comments.List | A Drive.Comments.List object. |
| Method |
public Drive.Comments.List setFileId(String fileId) |
| Sets a file ID. |
Parameters
| Parameter name | Parameter desc |
| fileId | File ID. |
Return
| type | desc |
| Drive.Comments.List | A Drive.Comments.List object. |
| Method |
public Drive.Comments.List setIncludeDeleted(Boolean includeDeleted) |
| Sets whether to return deleted comments. |
Parameters
| Parameter name | Parameter desc |
| includeDeleted | Indicates whether to return deleted comments. |
Return
| type | desc |
| Drive.Comments.List | A Drive.Comments.List object. |
| Method |
public Drive.Comments.List setPageSize(Integer pageSize) |
| Sets the maximum number of comments returned on each page. |
Parameters
| Parameter name | Parameter desc |
| pageSize | Maximum 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
| type | desc |
| Drive.Comments.List | A Drive.Comments.List object. |
| Method |
public Drive.Comments.List setCursor(String cursor) |
| Sets the start cursor for pagination query. |
Parameters
| Parameter name | Parameter desc |
| cursor | Cursor, 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
| type | desc |
| Drive.Comments.List | A 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 name | Parameter desc |
| prettyPrint | Indicates whether to return a response containing indentations and line-wrapping breaks. The value is a Boolean value. |
Return
| type | desc |
| Drive.Comments.List | A 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 name | Parameter desc |
| 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. |
Return
| type | desc |
| Drive.Comments.List | A Drive.Comments.List object. |
| Method |
public Drive.Comments.List setStartEditedTime(String startEditedTime) |
| Set the earliest modification time of a comment. |
Parameters
| Parameter name | Parameter desc |
| startEditedTime | Earliest modification time of a comment. |
Return
| type | desc |
| Drive.Comments.List | A Drive.Comments.List object. |
| Method |
public T execute() throws IOException |
| Sends an HTTP request and returns the object to be converted. |
Throws
| Parameter name | Parameter desc |
| java.io.IOException | I/O exception thrown upon an API call failure. You can use the getMessage() method to obtain the error description. |
Return
| type | desc |
| CommentList | The Drive.Comments.List class extends DriveRequest<CommentList>. Therefore, the return result of the execute() method is encapsulated as a CommentList object. |
Sample Code
- private void listComments(Drive drive, String fileId){
- try{
- CommentList list = drive.comments().list(fileId).execute();
- } catch (Exception e){
- Log.e(TAG, "listComments error: " + e.toString());
- }
- }