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 AttachmentContent
instance.updateDataCompletionStage
(ContentId attachmentId, AttachmentUpload upload) Updates the data part of an AttachmentContent
instance.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:RemoteAttachmentService
Add one or more attachments to a piece ofContent
.- Specified by:
addAttachmentsCompletionStage
in 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:
addAttachmentsCompletionStage
in interfaceRemoteAttachmentService
- Throws:
ServiceException
-
addAttachmentsCompletionStage
public CompletionStage<PageResponse<Content>> addAttachmentsCompletionStage(ContentId containerId, ContentStatus containerStatus, Collection<AttachmentUpload> uploads, boolean allowDuplicated, Expansions expansions) throws ServiceException - Specified by:
addAttachmentsCompletionStage
in interfaceRemoteAttachmentService
- Throws:
ServiceException
-
find
- Specified by:
find
in interfaceRemoteAttachmentService
-
updateCompletionStage
Description copied from interface:RemoteAttachmentService
Updates the non-data parts of an AttachmentContent
instance.This method can be used to update the container, filename, media-type and comment of an Attachment.
- Specified by:
updateCompletionStage
in 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:RemoteAttachmentService
Updates the data part of an AttachmentContent
instance.- Specified by:
updateDataCompletionStage
in 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:RemoteAttachmentService
Moves an Attachment from a page to new page.- Specified by:
moveAttachmentCompletionStage
in interfaceRemoteAttachmentService
attachmentId
- 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:RemoteAttachmentService
Moves an Attachment from a page to new page and also rename it.- Specified by:
moveAttachmentCompletionStage
in interfaceRemoteAttachmentService
attachmentId
- 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:RemoteAttachmentService
Removes an Attachment from the system.- Specified by:
deleteCompletionStage
in 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:RemoteAttachmentService
Trashes an attachment associated with an attachmentId.- Specified by:
removeAttachmentCompletionStage
in 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:RemoteAttachmentService
Removes a specific version of an attachment associated with given content.- Specified by:
removeAttachmentVersionCompletionStage
in 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
-