We use essential cookies for the website to function, as well as analytics cookies for analyzing and creating statistics of the website performance. To agree to the use of analytics cookies, click "Accept All". You can manage your preferences at any time by clicking "Cookie Settings" on the footer. More Information.

Only Essential Cookies
Accept All

Documents from this version have been archived, and will not continue to be maintained. Please use the latest version.

HMS Core ReferencesDrive KitClient APIservices.driveDrive.CommentsDrive.Comments.Get

Drive.Comments.Get

class info
public class Drive.Comments.Get extends DriveRequest<Comment>
Drive.Comments.Get class.

Protected Constructor Summary

Constructor name

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

Constructor for the Drive.Comments.Get class.

Public Method Summary

Return typeMethod 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.

Protected Constructors

constructor
protected Drive.Comments.Get(String fileId, String commentId)
Constructs a Drive.Comments.Get 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 Boolean getIncludeDeleted()

Checks whether to return deleted comments.

Return

typedesc
BooleanIndicates whether to return deleted comments.
Method


public boolean isIncludeDeleted()

Determines whether to return deleted comments.

Return

typedesc
booleanIndicates 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 nameParameter desc
parameterNameParameter name.
valueParameter value.

Return

typedesc
Drive.Comments.GetA Drive.Comments.Get object.
Method


public Drive.Comments.Get setForm(String form)

Sets the response data format.

Parameters

Parameter nameParameter desc
formResponse data format. The default response data format is JSON. The options of this parameter include json and content.

Return

typedesc
Drive.Comments.GetA Drive.Comments.Get object.
Method


public Drive.Comments.Get setCommentId(String commentId)

Sets a file comment ID.

Parameters

Parameter nameParameter desc
commentIdComment ID.

Return

typedesc
Drive.Comments.GetA Drive.Comments.Get object.
Method


public Drive.Comments.Get setFields(String fields)

Sets the fields to be contained in a response.

Parameters

Parameter nameParameter desc
fieldsFields 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

typedesc
Drive.Comments.GetA Drive.Comments.Get object.
Method


public Drive.Comments.Get setFileId(String fileId)

Sets a file ID.

Parameters

Parameter nameParameter desc
fileIdFile ID.

Return

typedesc
Drive.Comments.GetA Drive.Comments.Get object.
Method


public Drive.Comments.Get setIncludeDeleted(Boolean includeDeleted)

Sets whether to return deleted comments.

Parameters

Parameter nameParameter desc
includeDeletedIndicates whether to return deleted comments.

Return

typedesc
Drive.Comments.GetA 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 nameParameter desc
prettyPrintIndicates whether to return a response containing indentations and line-wrapping breaks. The value is a Boolean value.

Return

typedesc
Drive.Comments.GetA 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 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.GetA Drive.Comments.Get 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
CommentThe 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

Collapse
Word wrap
Dark theme
Copy code
  1. private void getComments(Drive drive, String fileId, String commentId){
  2.    try{
  3.        Comment mComment = drive.comments().get(fileId, commentId).execute();
  4.    } catch (Exception e){
  5.        Log.e(TAG, "getComments error: " + e.toString());
  6.    }
  7. }

This page may contain third-party content. For details, click here.
Search in References
Enter a keyword.