| class info |
| public class Drive.Comments.Create extends DriveRequest<Comment> |
| Drive.Comments.Create class. |
| Constructor name |
Drive.Comments.Create (String fileId, Comment content) Constructor for the Drive Comments.Create class. |
| Return type | Method name |
| String | getFileId() Obtains a file ID. |
| Drive.Comments.Create | set(String parameterName, Object value) Sets the given parameter value for the given parameter name. |
| Drive.Comments.Create | setForm(String form) Sets the response data format. |
| Drive.Comments.Create | setFields(String fields) Sets the fields to be contained in a response. |
| Drive.Comments.Create | setFileId(String fileId) Sets a file ID. |
| Drive.Comments.Create | setPrettyPrint(Boolean prettyPrint) Sets whether to return a response containing indentations and line-wrapping breaks. |
| Drive.Comments.Create | 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.Create (String fileId, Comment content) |
| Constructs a Drive.Comments.Create object. |
Parameters
| Parameter name | Parameter desc |
| fileId | File ID. |
| content | Comments object. |
| Method |
| public String getFileId() |
| Obtains a file ID. |
Return
| type | desc |
| String | File ID. |
| Method |
public Drive.Comments.Create 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.Create | A Drive.Comments.Create object. |
| Method |
public Drive.Comments.Create 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.Create | A Drive.Comments.Create object. |
| Method |
public Drive.Comments.Create 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. An asterisk (*) can be used to match all related fields. |
Return
| type | desc |
| Drive.Comments.Create | A Drive.Comments.Create object. |
| Method |
public Drive.Comments.Create setFileId(String fileId) |
| Sets a file ID. |
Parameters
| Parameter name | Parameter desc |
| fileId | File ID. |
Return
| type | desc |
| Drive.Comments.Create | A Drive.Comments.Create object. |
| Method |
public Drive.Comments.Create 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.Create | A Drive.Comments.Create object. |
| Method |
public Drive.Comments.Create 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.Create | A Drive.Comments.Create 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.Create class extends DriveRequest<Comment>. Therefore, the return result of the execute() method is encapsulated as a Comment object. |
Sample Code
- private void createComments(Drive drive, File file){
- try{
- Comment comment = new Comment();
- comment.setDescription("interface test");
- Comment mComment = drive.comments().create(file.getId(), comment).execute();
- } catch (Exception e){
- Log.e(TAG, "createComments error: " + e.toString());
- }
- }