目录

class info
public class Drive.Comments.Delete extends DriveRequest<Void>
Drive.Comments.Delete class.

Protected Constructor Summary

Constructor name

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

Constructor for the Drive.Comments.Delete class.

Public Method Summary

Return typeMethod name
String

getCommentId()

Obtains a file comment ID.

String

getFileId()

Obtains a file ID.

Drive.Comments.Delete

set(String parameterName, Object value)

Sets the given parameter value for the given parameter name.

Drive.Comments.Delete

setForm(String form)

Sets the response data format.

Drive.Comments.Delete

setCommentId(String commentId)

Sets a file comment ID.

Drive.Comments.Delete

setFields(String fields)

Sets the fields to be contained in a response.

Drive.Comments.Delete

setFileId(String fileId)

Sets a file ID.

Drive.Comments.Delete

setPrettyPrint(Boolean prettyPrint)

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

Drive.Comments.Delete

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.

void

execute()

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

Protected Constructors

constructor
protected Drive.Comments.Delete(String fileId, String commentId)
Constructs a Drive.Comments.Delete object.

Parameters

Parameter nameParameter desc
fileIdFile ID.
commentIdComment ID.

Public Methods

Method
public String getCommentId()
Obtains a file comment ID.

Return

typedesc
StringComment ID.
Method


public String getFileId()

Obtains a file ID.

Return

typedesc
StringFile ID.
Method


public Drive.Comments.Delete 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.DeleteA Drive.Comments.Delete object.
Method


public Drive.Comments.Delete 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.DeleteA Drive.Comments.Delete object.
Method


public Drive.Comments.Delete setCommentId(String commentId)

Sets a file comment ID.

Parameters

Parameter nameParameter desc
commentIdComment ID.

Return

typedesc
Drive.Comments.DeleteA Drive.Comments.Delete object.
Method


public Drive.Comments.Delete setFields(String fields)

Sets the fields to be contained in a response.

Parameters

Parameter nameParameter desc
fieldsFields to be contained in a response. An asterisk (*) can be used to match all related fields.

Return

typedesc
Drive.Comments.DeleteA Drive.Comments.Delete object.
Method


public Drive.Comments.Delete setFileId(String fileId)

Sets a file ID.

Parameters

Parameter nameParameter desc
fileIdFile ID.

Return

typedesc
Drive.Comments.DeleteA Drive.Comments.Delete object.
Method


public Drive.Comments.Delete 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.DeleteA Drive.Comments.Delete object.
Method


public Drive.Comments.Delete 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.DeleteA Drive.Comments.Delete object.
Method


public T execute() throws IOException

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

Throws

Parameter nameParameter desc

java.io.IOException

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

Note: The Drive.Comments.Delete class extends DriveRequest<Void>. Therefore, no result is returned if the execute() method is called in the Drive.Comments.Delete class.

Sample Code

  1. private void deleteComments(Drive drive, File file, Comment comment){
  2.      try{
  3.             drive.comments().delete(file.getId(), comment.getId()).execute();
  4.        } catch (Exception e){
  5.             Log.e(TAG, "deleteComments error: " + e.toString());
  6.        }
  7. }