org.ektorp.support
Class AttachmentsInOrderParser

java.lang.Object
  extended by org.ektorp.support.AttachmentsInOrderParser

public class AttachmentsInOrderParser
extends Object

A document's MIME multipart/related representation produced by CouchDB uses the order of the attachments in the JSON _attachments object as the order of the attachments in the multipart/related. Thus, the order must be preserved in order to parse a CouchDB multipart/related message. This class parses a document and returns the order of the attachments.

Author:
David Venable

Constructor Summary
AttachmentsInOrderParser()
           
 
Method Summary
static List<String> parseAttachmentNames(com.fasterxml.jackson.core.JsonParser documentJsonParser)
          Parses a CouchDB document in the form of a JsonParser to get the attachments order.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AttachmentsInOrderParser

public AttachmentsInOrderParser()
Method Detail

parseAttachmentNames

public static List<String> parseAttachmentNames(com.fasterxml.jackson.core.JsonParser documentJsonParser)
                                         throws IOException
Parses a CouchDB document in the form of a JsonParser to get the attachments order. It is important that the JsonParser come straight from the source document and not from an object, or the order will be incorrect.

Parameters:
documentJsonParser - a JsonParser which is at the very root of a JSON CouchDB document
Returns:
the list of attachment names in the order provided in the document
Throws:
IOException


Copyright © 2017. All rights reserved.