Attachment Class
- java.
lang. Object - JsonSerializable
- Resource
- com.
microsoft. azure. cosmosdb. Attachment
- com.
public class Attachment extends Resource
Represents a document attachment in the Azure Cosmos DB database service.
Each document may contain zero or more attachments. 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. |
Method Summary
Modifier and Type | Method and Description |
---|---|
String |
getContentType()
Gets the MIME content type of the attachment. |
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. |
Inherited Members
Constructor Details
Attachment
public Attachment()
Initialize an attachment object.
Attachment
public Attachment(String source)
Initialize an attachment object from json string.
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:
Applies to
Azure SDK for Java