Intelligent Assistant
Chat with our virtual assistant to get answers promptly.
| class info |
| public class Drive.Files.Get extends DriveRequest<File> |
| Drive.Files.Get class. |
| Constructor name |
Drive.Files.Get(String fileId) Constructor for the Drive.Files.Get class. |
| Return type | Method name |
| Drive.Files.Get | setFields(String fields) Sets the fields to be contained in a response. |
| Drive.Files.Get | set(String parameterName, Object value) Sets the given parameter value for the given parameter name. |
| String | getFileId() Obtains a file ID. |
| Drive.Files.Get | setFileId(String fileId) Sets a file ID. |
| File | execute() Sends an HTTP request and returns the object to be converted. |
| Drive.Files.Get | setForm(String form) Sets the response data format. |
| Drive.Files.Get | setPrettyPrint(Boolean prettyPrint) Sets whether to return a response containing indentations and line-wrapping breaks. |
| Drive.Files.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. |
| void | executeContentAndDownloadTo(java.io.OutputStream outputStream) Sends a media request to the server and writes the input stream of returned media content into the specified destination output stream. |
| java.io.InputStream | executeContentAsInputStream() Sends a media request to the server and returns a media content input stream. |
| HttpResponse | executeContent() Sends a media request to the server and returns media content. |
| Boolean | getAcknowledgeDownloadRisk() Checks whether a user acknowledges the download of known malware or files incurring risks. |
| Drive.Files.Get | setAcknowledgeDownloadRisk(Boolean acknowledgeDownloadRisk) Sets whether a user acknowledges the download of known malware or files incurring risks. |
| boolean | isAcknowledgeDownloadRisk() Determines whether a user acknowledges the download of known malware or files incurring risks |
| constructor |
| protected Drive.Files.Get(String fileId) |
| Constructs a the Drive.Files.Get object. |
Parameters
| Parameter name | Parameter desc |
| fileId | File ID, which is returned when a file list is obtained through the Files.list API. |
| Method |
| public Drive.Files.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 File object, for example, category, fileName, and size. If fields is set to asterisk (*), all attributes of a File object are returned. If fields is not set, the category, id, fileName, and mimeType attributes are returned by default. |
Return
| type | desc |
| Drive.Files.Get | A Drive.Files.Get object. |
| Method |
public Drive.Files.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.Files.Get | A Drive.Files.Get object. |
| Method |
public String getFileId() |
| Obtains a file ID. |
Return
| type | desc |
| String | File ID. |
| Method |
public Drive.Files.Get setFileId(String fileId) |
| Sets a file ID. |
Parameters
| Parameter name | Parameter desc |
| fileId | File ID. |
Return
| type | desc |
| Drive.Files.Get | A Drive.Files.Get object. |
| Method |
public void executeContentAndDownloadTo (java.io.OutputStream outputStream) |
| Sends a media request to the server and writes the input stream of returned media content into the specified destination output stream. |
Parameters
| Parameter name | Parameter desc |
| outputStream | Specified output stream. |
| Method |
public java.io.InputStream executeContentAsInputStream () |
| Sends a media request to the server and returns a media content input stream. |
Return
| type | desc |
| java.io.InputStream | Input stream. |
| Method |
public HttpResponse executeContent() |
| Sends a media request to the server and returns media content. |
Return
| type | desc |
| HttpResponse | An HttpResponse object. |
| Method |
public Drive.Files.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.Files.Get | A Drive.Files.Get object. |
| Method |
public Drive.Files.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 of the Boolean type. |
Return
| type | desc |
| Drive.Files.Get | A Drive.Files.Get object. |
| Method |
public Drive.Files.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.Files.Get | A Drive.Files.Get object. |
| Method |
public Boolean getAcknowledgeDownloadRisk() |
Checks whether a user acknowledges the download of known malware or files incurring risks. |
Returns
| Boolean | Indicates whether a user acknowledges the download of known malware or files incurring risks. |
| Method |
| public Drive.Files.Get setAcknowledgeDownloadRisk(Boolean acknowledgeDownloadRisk) |
| Sets whether a user acknowledges the download of known malware or files incurring risks. |
Parameters
| acknowledgeDownloadRisk | Indicates whether a user acknowledges the download of known malware or files incurring risks. |
Returns
| Drive.Files.Get | A Drive.Files.Get object. |
| Method |
| public boolean isAcknowledgeDownloadRisk() |
| Determines whether a user acknowledges the download of known malware or files incurring risks. |
Returns
| boolean | Indicates whether a user acknowledges the download of known malware or files incurring risks. |
| 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 |
| File | The Drive.Files.Get class extends DriveRequest<File>. The return result of the execute() method is encapsulated as a File object. The return result contains only the attributes specified by fields. |
Sample Code
- private void getFile(Drive drive, String fileId){
- try{
- File mfile = drive.files().get(fileId).execute();
- } catch (Exception e){
- Log.e(TAG, "getFile error: " + e.toString());
- }
- }