owncloud/ios-library — pull request #64 by eliburke (2014-10-08 15:01:30+00:00)
Title: Added parameters dictionary to OCWebDavClient's download path

* Added parameters dictionary to OCWebDavClient's download path
* Updated example code to explicitly download, download preview, or download in a session

You may prefer to re-work this so that the existing API does not change, but I was trying to keep the patch simple. The library changes are easy: add a dictionary for url parameters to downloadFile, and pass it through to OCWebDavClient and into the request object. Note that I also made the progress and background handlers optional.

The meat of the change is in the example app, which I tweaked to have three different download buttons. One of them will download a preview image. I put in a couple of comments that explain what is going on. A specific (unchanging) URL is requested with URL parameters to indicate the file that should be previewed, it's size, and whether or not its aspect should be preserved.

A better implementation of this might be to add a preview specific API to OCCommunicationLib, or perhaps move the bulk of downloadPreviewImage into OCFileDto, but there are a lot of different ways to scramble this egg.