Uploading files

There's actually two related use-cases for uploading files:

Creating a new file

Updating an existing file

You implement both cases with the same annotation, but different arguments. For creating a new resource the first argument is the parent folder to create in, followed by the name to give it, followed by the data. For updating the first argument is the object to update, followed by the data.

You can ask for the data as either a byte[] or an InputStream, and you can also have a Long argument which will be the content length, if its available.

Some examples below. This shows creating and updating contacts, where we parse the incoming data: