org.ektorp
Class Attachment

java.lang.Object
  extended by org.ektorp.Attachment
All Implemented Interfaces:
Serializable

public class Attachment
extends Object
implements Serializable

Author:
henrik lundgren
See Also:
Serialized Form

Constructor Summary
Attachment(String id, String data, String contentType)
          Constructor that takes data as String.
 
Method Summary
 Map<String,Object> getAnonymous()
           
 long getContentLength()
           
 String getContentType()
           
 String getDataBase64()
          Only populated if this attachment was created with data as String constructor.
 String getDigest()
           
 String getId()
           
 int getRevpos()
           
 boolean isStub()
           
 void setAnonymous(String key, Object value)
           
 void setRevpos(int revpos)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Attachment

public Attachment(String id,
                  String data,
                  String contentType)
Constructor that takes data as String. The data must be base64 encoded single line of characters, so pre-process your data to remove any carriage returns and newlines Useful if you want to save the attachment as an inline attachent.

Parameters:
id -
data - base64-encoded
contentType -
contentLength -
Method Detail

getContentType

public String getContentType()

getContentLength

public long getContentLength()

getDataBase64

public String getDataBase64()
Only populated if this attachment was created with data as String constructor.

Returns:

getId

public String getId()

isStub

public boolean isStub()

getRevpos

public int getRevpos()

setRevpos

public void setRevpos(int revpos)

getDigest

public String getDigest()

getAnonymous

public Map<String,Object> getAnonymous()
Returns:
a Map containing fields that did not map to any other field in the class during object deserializarion from a JSON document.

setAnonymous

public void setAnonymous(String key,
                         Object value)
Parameters:
key -
value -


Copyright © 2011. All Rights Reserved.