You are currently browsing legacy 3.0 version of documentation. Click here to switch to the newest 5.1 version.
Attachments: How to get attachment metadata only?
HeadAttachment can be used to download attachment metadata for a single attachment.
@Deprecated public Attachment headAttachment(String key);
|key||String||key of the attachment you want to download metadata for|
|Attachment||Object that represents attachment.|
Attachment attachment = store.getDatabaseCommands().headAttachment("albums/holidays/sea.jpg"); // null if does not exist
GetAttachmentHeadersStartingWith can be used to download attachment metadata for a multiple attachments.
@Deprecated public List<Attachment> getAttachmentHeadersStartingWith(String idPrefix, int start, int pageSize);
|idPrefix||String||prefix for which attachments should be returned|
|start||int||number of attachments that should be skipped|
|pageSize||int||maximum number of attachments that will be returned|
|List<AttachmentInformation>||Object that represents attachment metadata information.|
List<Attachment> attachments = store.getDatabaseCommands().getAttachmentHeadersStartingWith("albums/holidays/", 0, 10);
Attachment will throw for the above methods.