sonatype/nexus-oss — pull request #108 by cstamas (2013-08-30 15:19:52+00:00)
Title: NEXUS-5790: New content resource implementation

Cleanroom reimplementation of the `/content` resource using vanilla Servlet API, goal was to get rid of heaps of abstraction layers (Restlet).

This work is almost done, except of the "describe" views (3 of them, "describe", "info" and "maven2"). Those are implemented in a (hacky) way, to redirect the request to the "old" `/service/local/repositories/XXX` resource (powered by same code that is replaced for `/content`). This works just fine for UI and user clients (ie. users with browsers using `?describe`). But, it seems that IT client testing those is not fooled (3 IT fails as instead of expected 200 they got 302 HTTP response code, the redirect).

Another experiment is here (will separate if anyone request), modification of the `ContentLocator` interface, addition of `writeTo` method. Hence, `FileContentLocator` now uses `File.transferTo` to perform zero-copy. Zero-copy happens only on GETs, uploads are still "ol' fashioned IO" (not NIO), and will remain, as there, streams are wrapped to calculate digests on the fly, as content is getting stream up.

Measured transfers of this solution (see issue for numbers) are in range of Jetty's `Handler` results.

Issue
https://issues.sonatype.org/browse/NEXUS-5790

CI (3 failing ITs are for the "views" that are faked for now with redirects, all work in UI but IT client does not follow redirects it seems):
https://bamboo.zion.sonatype.com/browse/NX-OSSF37-6