public class RemoteAttachmentServiceImpl extends AbstractRemoteService<AttachmentService> implements RemoteAttachmentService
| Constructor and Description |
|---|
RemoteAttachmentServiceImpl(AuthenticatedWebResourceProvider provider,
com.google.common.util.concurrent.ListeningExecutorService executor) |
| Modifier and Type | Method and Description |
|---|---|
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.Boolean> |
canCreateAttachments(ContentId contentId)
Checks if the user is permitted to add attachments to the given content
|
com.atlassian.util.concurrent.Promise<java.lang.Void> |
delete(Content attachmentContent)
Removes an Attachment from the system.
|
com.atlassian.util.concurrent.Promise<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.
|
com.atlassian.util.concurrent.Promise<PageResponse<Content>> |
getAttachments(ContentId contentId,
PageRequest pageRequest,
AttachmentFilter filter,
Expansion... expansions)
Get a page of attachments under the
Content with the specified id. |
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. |
addExpansions, addPageRequest, addPageRequestParams, deleteFuture, getFutureGenericCollection, getFutureMapOfPageResponses, getFutureOption, getFuturePageResponseList, newRestWebResource, postFuture, postFuture, postFuture, postFutureToPageResponse, putFuturepublic RemoteAttachmentServiceImpl(AuthenticatedWebResourceProvider provider, com.google.common.util.concurrent.ListeningExecutorService executor)
public com.atlassian.util.concurrent.Promise<PageResponse<Content>> addAttachments(ContentId contentId, java.util.Collection<AttachmentUpload> uploads) throws ServiceException
RemoteAttachmentServiceContent.addAttachments in interface RemoteAttachmentServicecontentId - the id of the content to attach touploads - the attachments being uploadedServiceExceptionpublic com.atlassian.util.concurrent.Promise<java.lang.Boolean> canCreateAttachments(ContentId contentId)
RemoteAttachmentServicecanCreateAttachments in interface RemoteAttachmentServicecontentId - the id of the content to attach topublic com.atlassian.util.concurrent.Promise<PageResponse<Content>> getAttachments(ContentId contentId, PageRequest pageRequest, AttachmentFilter filter, Expansion... expansions) throws ServiceException
RemoteAttachmentServiceContent with the specified id.getAttachments in interface RemoteAttachmentServicecontentId - 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 Attachmentsexpansions - the expansions to apply to each Attachment in the returned pageServiceExceptionpublic com.atlassian.util.concurrent.Promise<com.atlassian.fugue.Option<Content>> findByContainerAndFilename(ContentId containerId, java.lang.String filename, Expansion... expansions) throws ServiceException
RemoteAttachmentServicefindByContainerAndFilename in interface RemoteAttachmentServicecontainerId - the id of the content containing the attachmentfilename - the name of the attachment fileexpansions - expansions to return on the Attachment contentServiceExceptionpublic com.atlassian.util.concurrent.Promise<Content> update(Content attachment) throws ServiceException
RemoteAttachmentServiceContent instance.
This method can be used to update the container, filename, media-type and comment of an Attachment.
update in interface RemoteAttachmentServiceattachment - the attachment to update, must include an idServiceExceptionpublic com.atlassian.util.concurrent.Promise<Content> updateData(ContentId attachmentId, AttachmentUpload upload) throws ServiceException
RemoteAttachmentServiceContent instance.updateData in interface RemoteAttachmentServiceattachmentId - the id of the attachment to updateupload - the new content of the AttachmentServiceExceptionpublic com.atlassian.util.concurrent.Promise<java.lang.Void> delete(Content attachmentContent) throws ServiceException
RemoteAttachmentServicedelete in interface RemoteAttachmentServiceattachmentContent - the content to removeServiceException - if the content cannot be found, or cannot be deletedCopyright © 2003-2014 Atlassian. All Rights Reserved.