Intelligent Assistant
Chat with our virtual assistant to get answers promptly.
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.
HUAWEI HMS Core
Documents from this version have been archived, and will not continue to be maintained. Please use the latest version.
| class info |
| public class Drive.Files.Copy extends DriveRequest<File> |
| Drive.Files.Copy class. |
| Constructor name |
Drive.Files.Copy(String fileId, File content) Constructor for the Drive.Files.Copy class. |
| Return type | Method name |
| Drive.Files.Copy | setFields(String fields) Sets the fields to be contained in a response. |
| Drive.Files.Copy | set(String parameterName, Object value) Sets the given parameter value for the given parameter name. |
| String | getFileId() Obtains a file ID. |
| Drive.Files.Copy | setFileId(String fileId) Sets a file ID. |
| File | execute() Sends an HTTP request and returns the object to be converted. |
| Drive.Files.Copy | setForm(String form) Sets the response data format. |
| Drive.Files.Copy | setPrettyPrint(Boolean prettyPrint) Sets whether to return a response containing indentations and line-wrapping breaks. |
| Drive.Files.Copy | 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. |
| constructor |
| protected Drive.Files.Copy (String fileId, File content) |
| Constructs an object of the Drive.Files.Copy class. |
Parameters
| Parameter name | Parameter desc |
| fileId | File ID. |
| content | File to be copied. |
| Method |
| public Drive.Files.Copy 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.Files.Copy | A Drive.Files.Copy object. |
| Method |
public Drive.Files.Copy 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.Copy | A Drive.Files.Copy object. |
| Method |
public String getFileId() |
| Obtains a file ID. |
Return
| type | desc |
| String | File ID. |
| Method |
public Drive.Files.Copy setFileId(String fileId) |
| Sets a file ID. |
Parameters
| Parameter name | Parameter desc |
| fileId | File ID. |
Return
| type | desc |
| Drive.Files.Copy | A Drive.Files.Copy object. |
| Method |
public Drive.Files.Copy 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.Files.Copy | A Drive.Files.Copy object. |
| Method |
public Drive.Files.Copy 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.Copy | A Drive.Files.Copy object. |
| Method |
public Drive.Files.Copy setQuotaId(String quotaId) |
| Sets a string of fewer 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 | 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. |
Return
| type | desc |
| Drive.Files.Copy | A Drive.Files.Copy 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 |
| File | The Drive.Files.Copy class extends DriveRequest<File>. Therefore, the return result of the execute() method is encapsulated as a DriveRequest<File> object. |
Sample Code
- private void copyFile(Drive drive, File file) {
- try {
- File copyFile = new File().setName(file.getName + "_copy");
- Drive.Files.Copy copyObject = drive.files().copy(file.getId(), copyFile);
- File mfile = copyObject.execute();
- } catch (Exception e) {
- Log.e(TAG, "copyFile error: " + e.toString());
- }
- }
Intelligent Assistant
Chat with our virtual assistant to get answers promptly.
Quick start
Helps you find desired resources with ease.