FileRequests Class

The FileRequests class provides methods that create file operation requests. Each method returns a new RestRequest object. Applications send this object to the Salesforce service to process the request. For example, the following code snippet calls the ownedFilesList() method to retrieve a RestRequest object. It then sends the RestRequest object to the server using RestClient.sendAsync():

Kotlin

1val ownedFilesRequest = FileRequests.ownedFilesList(null, null)
2val client = this.client
3client?.sendAsync(ownedFilesRequest, object : AsyncRequestCallback {
4// Do something with the response
5})
Java

1RestRequest ownedFilesRequest = FileRequests.ownedFilesList(null, null);
2RestClient client = this.client;
3client.sendAsync(ownedFilesRequest, new AsyncRequestCallback() {
4// Do something with the response
5});

This example passes null to the first parameter (userId). This value tells the ownedFilesList() method to use the ID of the context, or logged in, user. The second null, for the pageNum parameter, tells the method to fetch the first page of results.

Note

See Files and Networking for a full description of FileRequests methods.

Methods 

For a full reference of FileRequests methods, see Package com.salesforce.androidsdk.rest.files. For a full description of the REST request and response bodies, go to Connect REST API Developer Guide | Resources | Files Resources at http://www.salesforce.com/us/developer/docs/chatterapi.

We've Moved

Welcome to the new home of the Mobile SDK Developer Guide! For now, the Japanese guide can be found in PDF form.