Class Attachment

java.lang.Object
com.ibm.cloud.sdk.core.service.model.GenericModel
com.ibm.cloud.cloudant.v1.model.Attachment
All Implemented Interfaces:
ObjectModel

public class Attachment extends GenericModel
Schema for an attachment.
  • Method Details

    • newBuilder

      public Attachment.Builder newBuilder()
      New builder.
      Returns:
      a Attachment builder
    • contentType

      public String contentType()
      Gets the contentType. Attachment MIME type.
      Returns:
      the contentType
    • data

      public byte[] data()
      Gets the data. Base64-encoded content. Available when requested with `attachments=true` or `atts_since`. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (see `follows`). Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
      Returns:
      the data
    • digest

      public String digest()
      Gets the digest. Content hash digest. It starts with prefix declaring the hash type, `md5-` for example, and continues with the Base64-encoded hash digest.
      Returns:
      the digest
    • encodedLength

      public Long encodedLength()
      Gets the encodedLength. Compressed attachment size in bytes. Available for compressed attachments when requested with `att_encoding_info`. The database compresses attachments if the content_type is in the list of compressible types when added.
      Returns:
      the encodedLength
    • encoding

      public String encoding()
      Gets the encoding. Compression codec. Available for compressed attachments when requested with `att_encoding_info`. The database compresses attachments if the content_type is in the list of compressible types when added.
      Returns:
      the encoding
    • follows

      public Boolean follows()
      Gets the follows. True if the attachment follows in a multipart request or response.
      Returns:
      the follows
    • length

      public Long length()
      Gets the length. Real attachment size in bytes. Not available if inline attachment content requested.
      Returns:
      the length
    • revpos

      public Long revpos()
      Gets the revpos. Revision number at attachment addition.
      Returns:
      the revpos
    • stub

      public Boolean stub()
      Gets the stub. Has `true` value if object has stub attachment metadata, but not attachment content. Otherwise omitted in response.
      Returns:
      the stub