IPWorks Cloud 2020 Android Edition

Questions / Feedback?

UpdateResource Method

Updates a file or folder.

Syntax

public void updateResource(String resourceId);

Remarks

This method updates the metadata for the file or folder resource identified by ResourceId. For file resources, the file data can optionally be updated as well.

Usage

There must be a GDriveResource item in the Resources collection whose Id field matches the specified ResourceId value before this method is called.

  1. If necessary, call GetResourceInfo or ListResources to ensure an item with the resource's latest information is present in the Resources collection.
  2. Modify the GDriveResource item's fields as desired; the following fields are supported:
  3. For file resources, you may call SetUploadStream or set LocalFile or ResourceData if you wish to update the file data on the server. (Refer to UploadFile for more information about simple vs. resumable uploads and encrypting the file data before uploading.)
  4. Finally, call this method to update the resource.

// Load the latest information about the resource into the Resources collection.
string resId = "2309urjdojwefs0d09u";
googledrive.GetResourceInfo(resId);

// We'll update the file resource's name, description, and content.
googledrive.ResourceData = "new file content";
googledrive.Resources[0].Name = "CoolStuff2.txt";
googledrive.Resources[0].Description = "This is a text file with cool stuff in it";

googledrive.UpdateResource(resId);

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks Cloud 2020 Android Edition - Version 20.0 [Build 8265]