Creating a binary resource containing an RDF document can be achieved as follows:
curl -X POST --data-binary "@ore.rdf" -H "Content-Type: application/rdf+xml" -H "Slug: ore.rdf" -H "Content-Disposition: attachment; filename=\"ore.rdf\"" http://localhost:8080/rest
This creates a binary resource with mime type of application/rdf+xml as expected. Retrieving its contents via GET results in an exception, however (stack trace attached).
The problem is that ContentExposingResource is treating the binary content in a non-opaque fashion. It appears to be parsing its contents as RDF, adding (server-managed) triples from the associated object, and returning the union graph. An exception is thrown at some point during this process.
A possible solution is to simply treat all binary resources opaquely as bytes, eliminating the exception for RDF.