liveoak-io/liveoak — pull request #61 by mstruk (2014-01-16 16:36:13+00:00)
Title: LIVEOAK-73 Provide file upload / download endpoint using Mongo GridFS as storage

A new module mongo-gridfs is an implementation of a REST endpoint for uploading, and downloading large files which are stored in a MongoDB instance.

To support the ability to not load entire HTTP bodies into memory several changes had to be made to container module.
- Netty channel auto-read has been turned off for precise control of receiving read events.
- HttpRequestBodyHandler has been introduced which handles HTTP body upload
- changes have been made to support lazy body read by BinaryResources having to explicitly express interest in body
- resource state is always an instance of LazyResourceState when going through complete pipeline via http

Some of TODOs, and possible TODOs:
- download still loads a whole body into memory due to MyBinaryContentSink
- further cleanup needed of ResourceState, and BinaryResource, and upload / download handling
- updating existing blob resource
- updating just metadata
- additional file and directory metainfo
- partial uploads / downloads to continue interrupted operations
- transfer encoding to reduce size
- multiconnection upload / download in conjunction with partial upload / download for better bandwidth utilization