Attachment Class
- java.
lang. Object - com.
microsoft. azure. documentdb. JsonSerializable - com.
microsoft. azure. documentdb. Resource - com.
microsoft. azure. documentdb. Attachment
- com.
- com.
- com.
public class Attachment
extends Resource
Represents a document attachment in the Azure Cosmos DB database service.
Each document may contain zero or more attachemnts. Attachments can be of any MIME type - text, image, binary data. These are stored externally in Azure Blob storage. Attachments are automatically deleted when the parent document is deleted.
Constructor Summary
Constructor | Description |
---|---|
Attachment() |
Initialize an attachment object. |
Attachment(String source) |
Initialize an attachment object from json string. |
Attachment(JSONObject jsonObject) |
Initialize an attachment object from json object. |
Method Summary
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getContentType()
Gets the MIME content type of the attachment. |
java.lang.String |
getMediaLink()
Gets the media link associated with the attachment content. |
void |
setContentType(String contentType)
Sets the MIME content type of the attachment. |
void |
setMediaLink(String mediaLink)
Sets the media link associated with the attachment content. |
Methods inherited from JsonSerializable
Methods inherited from Resource
Methods inherited from java.lang.Object
Constructor Details
Attachment
public Attachment()
Initialize an attachment object.
Attachment
public Attachment(String source)
Initialize an attachment object from json string.
Parameters:
Attachment
public Attachment(JSONObject jsonObject)
Initialize an attachment object from json object.
Parameters:
Method Details
getContentType
public String getContentType()
Gets the MIME content type of the attachment.
Returns:
getMediaLink
public String getMediaLink()
Gets the media link associated with the attachment content.
Returns:
setContentType
public void setContentType(String contentType)
Sets the MIME content type of the attachment.
Parameters:
setMediaLink
public void setMediaLink(String mediaLink)
Sets the media link associated with the attachment content.
Parameters: