com.atlassian.confluence.rest.client
Class RemoteAttachmentServiceImpl

java.lang.Object
  extended by com.atlassian.confluence.rest.client.AbstractRemoteService<AttachmentService>
      extended by com.atlassian.confluence.rest.client.RemoteAttachmentServiceImpl
All Implemented Interfaces:
RemoteAttachmentService

public class RemoteAttachmentServiceImpl
extends AbstractRemoteService<AttachmentService>
implements RemoteAttachmentService

AttachmentService implementation that communicates with Confluence remotely using the Confluence REST api


Nested Class Summary
 class RemoteAttachmentServiceImpl.RemoteAttachmentFinderImpl
           
 
Nested classes/interfaces inherited from interface com.atlassian.confluence.rest.client.RemoteAttachmentService
RemoteAttachmentService.RemoteAttachmentFinder
 
Constructor Summary
RemoteAttachmentServiceImpl(AuthenticatedWebResourceProvider provider, com.google.common.util.concurrent.ListeningExecutorService executor)
           
 
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.
 AttachmentService.Validator validator()
          Remote validation not supported
 
Methods inherited from class com.atlassian.confluence.rest.client.AbstractRemoteService
addExpansions, addPageRequest, addPageRequestParams, deleteFuture, getFutureGenericCollection, getFutureMapOfPageResponses, getFutureOption, getFuturePageResponseList, newRestWebResource, postFuture, postFuture, postFuture, postFutureToPageResponse, putFuture
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RemoteAttachmentServiceImpl

public RemoteAttachmentServiceImpl(AuthenticatedWebResourceProvider provider,
                                   com.google.common.util.concurrent.ListeningExecutorService executor)
Method Detail

addAttachments

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

Specified by:
addAttachments in interface RemoteAttachmentService
Parameters:
contentId - the id of the content to attach to
uploads - the attachments being uploaded
Returns:
the attachments added
Throws:
ServiceException

find

public RemoteAttachmentService.RemoteAttachmentFinder find(Expansion... expansions)
Specified by:
find in interface RemoteAttachmentService

update

public com.atlassian.util.concurrent.Promise<Content> update(Content attachment)
                                                      throws ServiceException
Description copied from interface: RemoteAttachmentService
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.

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

updateData

public com.atlassian.util.concurrent.Promise<Content> updateData(ContentId attachmentId,
                                                                 AttachmentUpload upload)
                                                          throws ServiceException
Description copied from interface: RemoteAttachmentService
Updates the data part of an Attachment Content instance.

Specified by:
updateData in interface RemoteAttachmentService
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

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

Specified by:
delete in interface RemoteAttachmentService
Parameters:
attachmentContent - the content to remove
Throws:
ServiceException - if the content cannot be found, or cannot be deleted

validator

public AttachmentService.Validator validator()
Remote validation not supported

Throws:
java.lang.UnsupportedOperationException


Copyright © 2003-2014 Atlassian. All Rights Reserved.