public final class Attachment
extends java.lang.Object
| Modifier | Constructor and Description |
|---|---|
|
Attachment(java.io.InputStream contentStream,
java.lang.String contentType)
Constructor
|
protected |
Attachment(Revision revision,
java.lang.String name,
java.util.Map<java.lang.String,java.lang.Object> metadata)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
protected static BlobStoreWriter |
blobStoreWriterForBody(java.io.InputStream body,
Database database) |
protected java.io.InputStream |
getBodyIfNew() |
java.io.InputStream |
getContent()
Get the input stream of the content (aka 'body') data.
|
java.lang.String |
getContentType()
Get the MIME type of the contents.
|
java.net.URL |
getContentURL()
Get the URL of the file containing the contents.
|
Document |
getDocument()
Get the owning document.
|
long |
getLength()
Get the length in bytes of the contents.
|
java.util.Map<java.lang.String,java.lang.Object> |
getMetadata()
The CouchbaseLite metadata about the attachment, that lives in the document.
|
java.lang.String |
getName()
Get the filename.
|
Revision |
getRevision()
Get the owning document revision.
|
protected static java.util.Map<java.lang.String,java.lang.Object> |
installAttachmentBodies(java.util.Map<java.lang.String,java.lang.Object> attachments,
Database database)
Goes through an _attachments dictionary and replaces any values that are Attachment objects
with proper JSON metadata dicts.
|
protected void |
setName(java.lang.String name) |
protected void |
setRevision(Revision revision) |
public Attachment(java.io.InputStream contentStream,
java.lang.String contentType)
protected Attachment(Revision revision, java.lang.String name, java.util.Map<java.lang.String,java.lang.Object> metadata)
public Revision getRevision()
public Document getDocument()
public java.lang.String getName()
public java.lang.String getContentType()
public java.io.InputStream getContent()
throws CouchbaseLiteException
CouchbaseLiteExceptionpublic java.net.URL getContentURL()
public long getLength()
public java.util.Map<java.lang.String,java.lang.Object> getMetadata()
protected void setName(java.lang.String name)
protected void setRevision(Revision revision)
protected java.io.InputStream getBodyIfNew()
protected static java.util.Map<java.lang.String,java.lang.Object> installAttachmentBodies(java.util.Map<java.lang.String,java.lang.Object> attachments,
Database database)
throws CouchbaseLiteException
CouchbaseLiteExceptionprotected static BlobStoreWriter blobStoreWriterForBody(java.io.InputStream body, Database database) throws java.io.IOException, SymmetricKeyException
java.io.IOExceptionSymmetricKeyException