I'm trying to use jclouds to write to an S3-compatible object store (Ceph),
and I'd like to use an OutputStream to write the payload for a Blob. How do
I do this?
I'm working on an existing system which uses a stream-based abstraction
around all of the file I/O, that looks like this:
public interface ResourceFactory {
InputStream getInputStream(String resourcePath) throws IOException;
OutputStream getOutputStream(String resourcePath) throws IOException;
}
I was able to implement getInputStream() for *reading* a blob from jclouds,
but I'm not sure how to return an OutputStream for *writing* a blob.
I know this question has already been asked
<https://groups.google.com/forum/#!topic/jclouds/F2pCt9i7TSg>, but it seems
like a common-enough use case that it shouldn't be terribly complicated to
implement. Can anyone provide suggestions for how to accomplish this?
The best I could find is Payload#writeTo
<http://demobox.github.io/jclouds-maven-site-1.7.2/1.7.2/jclouds/apidocs/org/jclouds/io/WriteTo.html>,
which accepts an OutputStream but is @Deprecated. Thanks in advance!
*Steve Kingsland*
Senior Software Engineer
* Opower * <http://www.opower.com/>
* We’re hiring! See jobs here <http://www.opower.com/careers> *