Attachments: Get

There are few methods that allow you to download attachments from a database:
- GetAttachment
- GetAttachments

GetAttachment

GetAttachment can be used to download a single attachment.

Syntax

@Deprecated
public Attachment getAttachment(String key);
Parameters
key String key of the attachment you want to download
Return Value
Attachment Object that represents attachment.

Example

Attachment attachment = store.getDatabaseCommands().getAttachment("albums/holidays/sea.jpg"); // null if does not exist

GetAttachments

GetAttachments can be used to download attachment information for multiple attachments.

Syntax

@Deprecated
public AttachmentInformation[] getAttachments(int start, Etag startEtag, int pageSize);
Parameters
start int Indicates how many attachments should be skipped
startEtag Etag ETag from which to start
batchSize int maximum number of attachments that will be downloaded
Return Value
AttachmentInformation Object that represents attachment metadata information.

Example

AttachmentInformation[] attachments = store.getDatabaseCommands().getAttachments(0, Etag.empty(), 10);