Intelligent Assistant
Chat with our virtual assistant to get answers promptly.
Documents from this version have been archived, and will not continue to be maintained. Please use the latest version.
| class info |
| public class Drive.Comments.Get extends DriveRequest<Comment> |
| Drive.Comments.Get class. |
| Constructor name |
Drive.Comments.Get(String fileId, String commentId) Constructor for the Drive.Comments.Get class. |
| Return type | Method name |
| String | getCommentId() Obtains a file comment ID. |
| String | getFileId() Obtains a file ID. |
| Boolean | getIncludeDeleted() Checks whether to return deleted comments. |
| boolean | isIncludeDeleted() Determines 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. |
| 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 line-wrapping breaks. |
| 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. |
| constructor |
| protected Drive.Comments.Get(String fileId, String commentId) |
| Constructs a Drive.Comments.Get object. |
Parameters
| Parameter name | Parameter desc |
| fileId | File ID. |
| commentId | Comment ID. |
| Method |
| public String getCommentId() |
| Obtains a file comment ID. |
Return
| type | desc |
| String | Comment ID. |
| 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 boolean isIncludeDeleted() |
| Determines whether to return deleted comments. |
Return
| type | desc |
| boolean | Indicates whether to return deleted comments. |
| Method |
public Drive.Comments.Get 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.Get | A Drive.Comments.Get object. |
| Method |
public Drive.Comments.Get setForm(String form) |
| Sets the response data format. |
Parameters
| Parameter name | Parameter desc |
| form | Response data format. The default response data format is JSON. The options of this parameter include json and content. |
Return
| type | desc |
| Drive.Comments.Get | A Drive.Comments.Get object. |
| Method |
public Drive.Comments.Get setCommentId(String commentId) |
| Sets a file comment ID. |
Parameters
| Parameter name | Parameter desc |
| commentId | Comment ID. |
Return
| type | desc |
| Drive.Comments.Get | A Drive.Comments.Get object. |
| Method |
public Drive.Comments.Get 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, that is, attributes of a Comment object, for example, category, createdTime, creator/category, and description. If fields is set to *, all attributes of the Comment object are returned.If fields is not set, the system returns category, description, and htmlDescription by default. |
Return
| type | desc |
| Drive.Comments.Get | A Drive.Comments.Get object. |
| Method |
public Drive.Comments.Get setFileId(String fileId) |
| Sets a file ID. |
Parameters
| Parameter name | Parameter desc |
| fileId | File ID. |
Return
| type | desc |
| Drive.Comments.Get | A Drive.Comments.Get object. |
| Method |
public Drive.Comments.Get 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.Get | A Drive.Comments.Get object. |
| Method |
public Drive.Comments.Get 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.Get | A Drive.Comments.Get object. |
| 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
| 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.Get | A Drive.Comments.Get 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 |
| Comment | The Drive.Comments.Get class extends 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.toString());
- }
- }