sakaiproject/Hilary — pull request #228 by simong (2012-11-01 19:33:55+00:00)
Title: Initial implementation for file storage.

This PR is mainly to have someone look at the work that has been done for files.
Especially on how revisions are being stored.

Currently everything that the storage backends/users need sits in one column, but I'm not too sure if that's the right way to do it.
A revision holds:
* a timestamp (column name)
* the user who made the revision
* A uri to the actual content of the revision, which in itself exists out of:
* The name of the storage backend
* An inner-uri which allows the storage backend to retrieve/delete/.. the actual content
* The content filename (optional)
* The content mimetype (optional)

````
id | 1351797276275
------------------+-------------------------------------------------------------------------------------------------------------------
c:cam:eeeK6Hs7eM | u:cam:simong#amazons3:2012/10/1/19/14/TVJBtHcHV5/slf4j-api-1.6.3.jar#slf4j-api-1.6.3.jar#application/java-archive
```

I've tested this out on my local box and I'm able to stream to S3 or store them to disk, both are configurable in the admin UI. When using the local

Storage backends:
* Local file storage
* Streams uploads to disk. (this could just use a setting on the bodyParser, but then it would not be reconfigurable at runtime)
* Amazon
* Uploads to amazon once the file is fully on disk locally.
* Downloads are done by redirecting the user to a signed URL which is only valid once.

Possible optimizations
* Stream uploads as they come in.

Todo:
* Fix up tests