I made a change to support Couch's MIME multipart/related PUT operation. This allows for pushing a document along with its attachments relatively efficiently.
More information on this Couch API is available:
Added the updateMultipart method to the CouchDbConnector to support C…
…ouch's MIME multipart/related PUT operation.
Support a null boundary by leaving off the boundary part of the Conte…
…nt-Type. So the resulting Content-Type will simply be "multipart/related".
If boundary is nullable, I think there should be a updateMultipart method without the boundary argument as well.
Some documentation on this feature would not hurt. could you write a multipart section under Chapter 7. Attachments:
Added the updateMultipart overload without the boundary.
Added reference documentation for uploading a document with attachmen…
…ts using the updateMultipart method.
I added the new overload without boundary. The updateMultipart with a boundary still accepts null. Should it require it non-null since there is an overload?
I also updated the reference documentation.
one question though, what is the use case for updating a document without a boundary, i.e. just the doc? why not use one of the ordinary update methods in that case?
if there's no real use case for it, maybe we should remove the overloaded method and make boundary a required argument.
what do you think?
The particular use case is that I need to update the document 1) as a stream and 2) with Options. I think that a new update method could handle this rather than the null boundary.
void updateAsStream(String id, InputStream document, long documentLength, Options options);
Would you prefer that method? If so, I can try that and make the necessary changes.
ok, I see.
call it just void update(String id, InputStream document, long documentLength, Options options)
Removed the updateMultipart overload which did not take a boundary. T…
…o provide similar functionality created a new update method which takes an InputStream containing a JSON document.
I added the new update method. I also created a new section in the reference documentation under "Update" in chapter 5. I do prefer this method over the updateMultipart.
To clarify on the use-case, this allows us to update documents straight from JSON documents without having to parse the document. This is very helpful for some very large documents that we have.