com.atlassian.confluence.rest.client
Interface RemoteAttachmentService

All Known Implementing Classes:
RemoteAttachmentServiceImpl

public interface RemoteAttachmentService

* AttachmentService implementation that communicates with Confluence remotely using the Confluence REST API. Provides future returning equivalents for the methods in AttachmentService.


Nested Class Summary
static interface RemoteAttachmentService.RemoteAttachmentFinder
           
 
Method Summary
 com.atlassian.util.concurrent.Promise<PageResponse<Content>> addAttachments(ContentId contentId, java.util.Collection<AttachmentUpload> uploads)
          Add one or more attachments to a piece of Content.
 com.atlassian.util.concurrent.Promise<java.lang.Void> delete(Content attachmentContent)
          Removes an Attachment from the system.
 RemoteAttachmentService.RemoteAttachmentFinder find(Expansion... expansions)
           
 com.atlassian.util.concurrent.Promise<Content> update(Content attachment)
          Updates the non-data parts of an Attachment Content instance.
 com.atlassian.util.concurrent.Promise<Content> updateData(ContentId attachmentId, AttachmentUpload upload)
          Updates the data part of an Attachment Content instance.
 

Method Detail

addAttachments

com.atlassian.util.concurrent.Promise<PageResponse<Content>> addAttachments(ContentId contentId,
                                                                            java.util.Collection<AttachmentUpload> uploads)
                                                                            throws ServiceException
Add one or more attachments to a piece of Content.

Parameters:
contentId - the id of the content to attach to
uploads - the attachments being uploaded
Returns:
the attachments added
Throws:
ServiceException

find

RemoteAttachmentService.RemoteAttachmentFinder find(Expansion... expansions)

update

com.atlassian.util.concurrent.Promise<Content> update(Content attachment)
                                                      throws ServiceException
Updates the non-data parts of an Attachment Content instance.

This method can be used to update the container, filename, media-type and comment of an Attachment.

Parameters:
attachment - the attachment to update, must include an id
Returns:
the updated attachment as stored in the database
Throws:
ServiceException

updateData

com.atlassian.util.concurrent.Promise<Content> updateData(ContentId attachmentId,
                                                          AttachmentUpload upload)
                                                          throws ServiceException
Updates the data part of an Attachment Content instance.

Parameters:
attachmentId - the id of the attachment to update
upload - the new content of the Attachment
Returns:
the updated attachment as stored in the database
Throws:
ServiceException

delete

com.atlassian.util.concurrent.Promise<java.lang.Void> delete(Content attachmentContent)
                                                             throws ServiceException
Removes an Attachment from the system.

Parameters:
attachmentContent - the content to remove
Throws:
ServiceException - if the content cannot be found, or cannot be deleted


Copyright © 2003-2014 Atlassian. All Rights Reserved.