Class RemoteAttachmentServiceImpl
java.lang.Object
com.atlassian.confluence.rest.client.AbstractRemoteService<AttachmentService>
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
Nested ClassesNested classes/interfaces inherited from interface com.atlassian.confluence.rest.client.RemoteAttachmentService
RemoteAttachmentService.RemoteAttachmentFinder -
Field Summary
Fields inherited from class com.atlassian.confluence.rest.client.AbstractRemoteService
provider -
Constructor Summary
ConstructorsConstructorDescriptionRemoteAttachmentServiceImpl(AuthenticatedWebResourceProvider provider, ExecutorService executor) -
Method Summary
Modifier and TypeMethodDescriptionaddAttachmentsCompletionStage(ContentId contentId, ContentStatus status, Collection<AttachmentUpload> uploads) addAttachmentsCompletionStage(ContentId containerId, ContentStatus containerStatus, Collection<AttachmentUpload> uploads, boolean allowDuplicated, Expansions expansions) addAttachmentsCompletionStage(ContentId contentId, Collection<AttachmentUpload> uploads) Add one or more attachments to a piece ofContent.deleteCompletionStage(Content attachmentContent) Removes an Attachment from the system.moveAttachmentCompletionStage(ContentId contentId, ContentId attachmentId, ContentId newContentId) Moves an Attachment from a page to new page.moveAttachmentCompletionStage(ContentId contentId, ContentId attachmentId, ContentId newContentId, String newName) Moves an Attachment from a page to new page and also rename it.removeAttachmentCompletionStage(ContentId contentId, ContentId attachmentId) Trashes an attachment associated with an attachmentId.removeAttachmentVersionCompletionStage(ContentId contentId, ContentId attachmentId, int version) Removes a specific version of an attachment associated with given content.updateCompletionStage(Content attachment) Updates the non-data parts of an AttachmentContentinstance.updateDataCompletionStage(ContentId attachmentId, AttachmentUpload upload) Updates the data part of an AttachmentContentinstance.Remote validation not supportedMethods inherited from class com.atlassian.confluence.rest.client.AbstractRemoteService
addExpansions, addPageRequest, addPageRequestParams, deleteCompletionStage, deleteCompletionStage, getCompletionStage, getCompletionStageGenericCollection, getCompletionStageMap, getCompletionStageMapOfGenericListResponse, getCompletionStageMapOfPageResponses, getCompletionStageOptional, getCompletionStagePageResponseList, getCompletionStageSearchPageResponseList, getExecutor, newExperimentalRestWebTarget, newWebTarget, postCompletionStage, postCompletionStage, postCompletionStage, postCompletionStageToPageResponse, postVoidCompletionStage, putCompletionStage, putVoidCompletionStage
-
Constructor Details
-
RemoteAttachmentServiceImpl
public RemoteAttachmentServiceImpl(AuthenticatedWebResourceProvider provider, ExecutorService executor) - Since:
- 9.0
-
-
Method Details
-
addAttachmentsCompletionStage
public CompletionStage<PageResponse<Content>> addAttachmentsCompletionStage(ContentId contentId, Collection<AttachmentUpload> uploads) throws ServiceException Description copied from interface:RemoteAttachmentServiceAdd one or more attachments to a piece ofContent.- Specified by:
addAttachmentsCompletionStagein interfaceRemoteAttachmentService- Parameters:
contentId- the id of the content to attach touploads- the attachments being uploaded- Returns:
- the attachments added
- Throws:
ServiceException
-
addAttachmentsCompletionStage
public CompletionStage<PageResponse<Content>> addAttachmentsCompletionStage(ContentId contentId, ContentStatus status, Collection<AttachmentUpload> uploads) throws ServiceException - Specified by:
addAttachmentsCompletionStagein interfaceRemoteAttachmentService- Throws:
ServiceException
-
addAttachmentsCompletionStage
public CompletionStage<PageResponse<Content>> addAttachmentsCompletionStage(ContentId containerId, ContentStatus containerStatus, Collection<AttachmentUpload> uploads, boolean allowDuplicated, Expansions expansions) throws ServiceException - Specified by:
addAttachmentsCompletionStagein interfaceRemoteAttachmentService- Throws:
ServiceException
-
find
- Specified by:
findin interfaceRemoteAttachmentService
-
updateCompletionStage
Description copied from interface:RemoteAttachmentServiceUpdates the non-data parts of an AttachmentContentinstance.This method can be used to update the container, filename, media-type and comment of an Attachment.
- Specified by:
updateCompletionStagein interfaceRemoteAttachmentService- Parameters:
attachment- the attachment to update, must include an id- Returns:
- the updated attachment as stored in the database
- Throws:
ServiceException
-
updateDataCompletionStage
public CompletionStage<Content> updateDataCompletionStage(ContentId attachmentId, AttachmentUpload upload) throws ServiceException Description copied from interface:RemoteAttachmentServiceUpdates the data part of an AttachmentContentinstance.- Specified by:
updateDataCompletionStagein interfaceRemoteAttachmentService- Parameters:
attachmentId- the id of the attachment to updateupload- the new content of the Attachment- Returns:
- the updated attachment as stored in the database
- Throws:
ServiceException
-
moveAttachmentCompletionStage
public CompletionStage<Void> moveAttachmentCompletionStage(ContentId contentId, ContentId attachmentId, ContentId newContentId) throws ServiceException Description copied from interface:RemoteAttachmentServiceMoves an Attachment from a page to new page.- Specified by:
moveAttachmentCompletionStagein interfaceRemoteAttachmentServiceattachmentId- the attachment that should be moved.newContentId- the id of the new page attachment should be on.- Throws:
ServiceException- if the content cannot be found, or cannot be deleted
-
moveAttachmentCompletionStage
public CompletionStage<Void> moveAttachmentCompletionStage(ContentId contentId, ContentId attachmentId, ContentId newContentId, String newName) throws ServiceException Description copied from interface:RemoteAttachmentServiceMoves an Attachment from a page to new page and also rename it.- Specified by:
moveAttachmentCompletionStagein interfaceRemoteAttachmentServiceattachmentId- the attachment that should be moved.newContentId- the id of the new page attachment should be on.newName- the new name for the attachment if required.- Throws:
ServiceException- if the content cannot be found, or cannot be deleted
-
deleteCompletionStage
public CompletionStage<Void> deleteCompletionStage(Content attachmentContent) throws ServiceException Description copied from interface:RemoteAttachmentServiceRemoves an Attachment from the system.- Specified by:
deleteCompletionStagein interfaceRemoteAttachmentService- Parameters:
attachmentContent- the content to remove- Throws:
ServiceException- if the content cannot be found, or cannot be deleted
-
removeAttachmentCompletionStage
public CompletionStage<Void> removeAttachmentCompletionStage(ContentId contentId, ContentId attachmentId) throws ServiceException Description copied from interface:RemoteAttachmentServiceTrashes an attachment associated with an attachmentId.- Specified by:
removeAttachmentCompletionStagein interfaceRemoteAttachmentService- Parameters:
contentId- the id of the container/page to which attachment belongsattachmentId- the id of the attachment to trash- Throws:
ServiceException- if the content cannot be found, or cannot be deleted
-
removeAttachmentVersionCompletionStage
public CompletionStage<Void> removeAttachmentVersionCompletionStage(ContentId contentId, ContentId attachmentId, int version) Description copied from interface:RemoteAttachmentServiceRemoves a specific version of an attachment associated with given content.- Specified by:
removeAttachmentVersionCompletionStagein interfaceRemoteAttachmentService- Parameters:
contentId- The id of the content to which the attachment belongs.attachmentId- The id of the attachment to be removed.version- The version of the attachment to be removed.- Returns:
- a completion stage that, when completed, signifies that the attachment version has been successfully removed.
-
validator
Remote validation not supported- Throws:
UnsupportedOperationException
-