|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
@ExperimentalApi public interface AttachmentService
Provides methods for creating, reading, updating and deleting Confluence Attachment Content objects.
| Nested Class Summary | |
|---|---|
static interface |
AttachmentService.AttachmentFinder
A finder for locating attachments. |
static interface |
AttachmentService.Validator
Provides methods for validating the actions on the AttachmentService |
| Field Summary | |
|---|---|
static java.lang.String |
COMMENT_METADATA_KEY
Attachment Comments are stored in the Content metadata as the "comment" entry. |
static java.lang.String |
MEDIA_TYPE_METADATA_KEY
Attachment Media Type is stored in the Content metadata as the "mediaType" entry. |
| Method Summary | |
|---|---|
PageResponse<Content> |
addAttachments(ContentId containerId,
java.util.Collection<AttachmentUpload> uploads)
Add one or more attachments to a piece of Content. |
void |
delete(Content attachment)
Removes an Attachment from the system. |
AttachmentService.AttachmentFinder |
find(Expansion... expansions)
Creates an attachment finder for locating attachments. |
Content |
update(Content attachment)
Updates the non-data parts of an Attachment Content instance. |
Content |
updateData(ContentId attachmentId,
AttachmentUpload upload)
Updates the data part of an Attachment Content instance. |
AttachmentService.Validator |
validator()
Provides a validator for validating actions on the AttachmentService and checking permissions related to attachments on Content |
| Field Detail |
|---|
static final java.lang.String COMMENT_METADATA_KEY
Content metadata as the "comment" entry.
static final java.lang.String MEDIA_TYPE_METADATA_KEY
Content metadata as the "mediaType" entry.
| Method Detail |
|---|
PageResponse<Content> addAttachments(ContentId containerId,
java.util.Collection<AttachmentUpload> uploads)
throws ServiceException
Content.
containerId - the id of the content to attach touploads - the attachments being uploaded
ServiceExceptionAttachmentService.AttachmentFinder find(Expansion... expansions)
Content attachment = attachmentService.find()
.withContainerId(pageId)
.withFilename("myfile.txt")
.fetchOneOrNull();
expansions - the expansions to apply to the values returned from a fetch
Content update(Content attachment)
throws ServiceException
Content instance.
This method can be used to update the container, filename, media-type and comment of an Attachment.
attachment - the attachment to update, must include an id
ServiceException
Content updateData(ContentId attachmentId,
AttachmentUpload upload)
throws ServiceException
Content instance.
attachmentId - the id of the attachment to updateupload - the new content of the Attachment
ServiceExceptionAttachmentService.Validator validator()
void delete(Content attachment)
throws ServiceException
attachment - the content to remove
ServiceException - if the content cannot be found, or cannot be deleted
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||