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.


Method Summary
 java.util.concurrent.Future<PageResponse<Content>> addAttachments(ContentId contentId, java.util.Collection<AttachmentUpload> uploads)
          Add one or more attachments to a piece of Content.
 java.util.concurrent.Future<java.lang.Boolean> canCreateAttachments(ContentId contentId)
          Checks if the user is permitted to add attachments to the given content
 java.util.concurrent.Future<com.atlassian.fugue.Option<Content>> findByContainerAndFilename(ContentId containerId, java.lang.String filename, Expansion... expansions)
          Locates a single Attachment given the id of its container Content and its file name.
 java.util.concurrent.Future<PageResponse<Content>> getAttachments(ContentId contentId, PageRequest pageRequest, AttachmentFilter filter, Expansion... expansions)
          Get a page of attachments under the Content with the specified id.
 java.util.concurrent.Future<Content> updateData(ContentId attachmentId, AttachmentUpload upload)
          Updates the data part of an Attachment Content instance.
 

Method Detail

addAttachments

java.util.concurrent.Future<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

canCreateAttachments

java.util.concurrent.Future<java.lang.Boolean> canCreateAttachments(ContentId contentId)
Checks if the user is permitted to add attachments to the given content

Parameters:
contentId - the id of the content to attach to
Returns:
true if the user can add attachments to the given content

getAttachments

java.util.concurrent.Future<PageResponse<Content>> getAttachments(ContentId contentId,
                                                                  PageRequest pageRequest,
                                                                  AttachmentFilter filter,
                                                                  Expansion... expansions)
                                                                  throws ServiceException
Get a page of attachments under the Content with the specified id.

Parameters:
contentId - id of the Content that contains the attachments.
pageRequest - - a pageRequest indicating how much content to retrieve.
filter - - a filter to apply to the found Attachments
expansions - the expansions to apply to each Attachment in the returned page
Returns:
a page of attachments
Throws:
ServiceException

findByContainerAndFilename

java.util.concurrent.Future<com.atlassian.fugue.Option<Content>> findByContainerAndFilename(ContentId containerId,
                                                                                            java.lang.String filename,
                                                                                            Expansion... expansions)
                                                                                            throws ServiceException
Locates a single Attachment given the id of its container Content and its file name.

Parameters:
containerId - the id of the content containing the attachment
filename - the name of the attachment file
expansions - expansions to return on the Attachment content
Returns:
the found attachment in an Option
Throws:
ServiceException

updateData

java.util.concurrent.Future<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


Copyright © 2003-2014 Atlassian. All Rights Reserved.