目录

class info
public class Drive.Replies.Create extends DriveRequest<Reply>
Drive. Replies.Create class.

Protected Constructor Summary

Constructor name

Drive.Replies.Create (String fileId, String commentId, Reply content)

Constructor for the Drive.Replies.Create class.

Public Method Summary

Return typeMethod name
String

getCommentId()

Obtains the ID of a comment replied.

String

getFileId()

Obtains the ID of a file whose comment is replied.

Drive.Replies.Create

set(String parameterName, Object value)

Sets the given parameter value for the given parameter name.

Drive.Replies.Create

setCommentId(String commentId)

Sets the ID of a comment replied.

Drive.Replies.Create

setFields(String fields)

Sets the fields to be contained in a response.

Drive.Replies.Create

setFileId(String fileId)

Sets the ID of a file whose comment is replied.

Drive.Replies.Create

setForm(String form)

Sets the response data format.

Drive.Replies.Create

setPrettyPrint(Boolean prettyPrint)

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

Drive.Replies.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.

Reply

execute()

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

Protected Constructors

constructor
protected Drive.Replies.Create(String fileId, String commentId, Reply content)
Constructs a Drive.Replies.Create object.

Parameters

Parameter nameParameter desc
fileIdFile ID.
commentIdComment ID.
contentReply.

Public Methods

Method
public String getCommentId()
Obtains the ID of a comment replied.

Return

typedesc
StringComment ID.
Method
public String getFileId()
Obtains the ID of a file whose comment is replied.

Return

typedesc
StringID of a file whose comment is replied.
Method


public Drive.Replies.Create 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.Replies.CreateA Drive.Replies.Create object.
Method


public Drive.Replies.Create setCommentId(String commentId)

Sets the ID of a comment replied.

Parameters

Parameter nameParameter desc
commentIdComment ID.

Return

typedesc
Drive.Replies.CreateA Drive.Replies.Create object.
Method


public Drive.Replies.Create 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.Replies.CreateA Drive.Replies.Create object.
Method


public Drive.Replies.Create setFileId(String fileId)

Sets the ID of a file whose comment is replied.

Parameters

Parameter nameParameter desc
fileIdID of a file whose comment is replied.

Return

typedesc
Drive.Replies.CreateA Drive.Replies.Create object.
Method


public Drive.Replies.Create setForm(String form)

Sets the response data format.

Parameters

Parameter nameParameter desc
formResponse data format.

Return

typedesc
Drive.Replies.CreateA Drive.Replies.Create object.
Method


public Drive.Replies.Create setPrettyPrint(Boolean prettyPrint)

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

Parameters

Parameter nameParameter desc
prettyPrintResponse containing indentations and line-wrapping breaks.

Return

typedesc
Drive.Replies.CreateA Drive.Replies.Create object.
Method


public Drive.Replies.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 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.Replies.CreateA Drive.Replies.Create 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
ReplyThe Drive.Replies.Create class extends DriveRequest. Therefore, the return result of the execute() method is encapsulated as a Reply object.


Code Example

  1. private void createReplies(String mFile, String mComment, Reply mReply) {
  2.   Drive drive = DriveUtil.buildDrive();
  3.   if (drive == null) {
  4.       Log.e(TAG, "createReplies error: drive is null.");
  5.       sendHandleMessage(R.id.drive_replies_create, FAIL);
  6.       return;
  7.   }
  8.   if (mFile == null) {
  9.       Log.e(TAG, "createReplies error: mFile is null.");
  10.       sendHandleMessage(R.id.drive_replies_create, FAIL);
  11.       return;
  12.   }
  13.   if (mComment == null) {
  14.       Log.e(TAG, "createReplies error: mComment is null.");
  15.       sendHandleMessage(R.id.drive_replies_create, FAIL);
  16.       return;
  17.   }
  18.   try {
  19.       Reply reply = new Reply();
  20.       reply.setDescription("interface test reply");
  21.       reply.setOperate("resolve");
  22.       mReply = drive.replies().create(mFile.getId(), mComment.getId(), reply).setFields("*").execute();
  23.       sendHandleMessage(R.id.drive_replies_create, SUCCESS);
  24.   } catch (Exception ex) {
  25.       sendHandleMessage(R.id.drive_replies_create, FAIL);
  26.       Log.e(TAG, "createReplies error: " + ex.toString());
  27.   }