First implementation of repository API (See #9678)


New views in webgateway:

^repositories/$

json method: Returns a list of repositories and their indices


^repositories/(?P<index>\d+)/$

json method: Returns a repository and its root property


^repositories/(?P<index>\d+)/list/(?P<filepath>.+)?$

json method: Returns a list of files in a repository.  If filepath is not specified,
returns files at the top level of the repository, otherwise files within
the specified filepath


^repositories/(?P<index>\d+)/listfiles/(?P<filepath>.+)?$

json method: Returns a list of files and some of their metadata in a repository.
If filepath is not specified, returns files at the top level of the
repository, otherwise files within the specified filepath


^repositories/(?P<index>\d+)/root/$

json method: Returns the root and name property of a repository


^repositories/(?P<index>\d+)/download/(?P<filepath>.+)$

Downloads a file from a repository.  Supports the HTTP_RANGE header to
perform partial downloads or download continuation


^repositories/(?P<index>\d+)/upload/(?P<filepath>.+)$

json method: Upload a file into a repository using multi-part upload.  Modeled on
the Amazon S3 MPU calls.

POST /filepath?uploads - Initiates the upload and returns an uploadId
PUT /filepath?uploadId=X&partNumber=Y - uploads a file part
GET /filepath?uploadId=X - returns a list of already uploaded parts
POST /filepath?uploadId=X - assembles file parts and submits to repository
DELETE /filepath?uploadId=X - abort upload process


^repositories/clean_mpus/$

json method: Remove incomplete multi-part uploads that have not been active in a
certain timeout period.  Returns a list of all uploads before any
are removed.
Remove logging to stdout
Inject _attrs to include file size in OriginalFileWrapper.simpleMarshal
Raise 404 when trying to download non-existant file
Change file download to not read full file into memory
Return empty list when requesting non-existant path
Return file modification time
Add API call for repository.makeDir()
Add API call to calculate SHA checksum for file in repository
Hide files starting with '.' from list and listfiles API calls
Pass connection to ConnCleaningHttpResponse
Require POST method for clean_incomplete_mpus API call
Add some simple unit tests for repository API
Add unit tests to check permissions on managed repository API
Fix comment
Add more permissions related tests
Switch to class based repository resolution from indexes.
Add force parameter to makedir to avoid errors when directory exists.
Be a little bit safer about imports.
Ensure that the service is closed.