Class AttachmentResource
java.lang.Object
com.atlassian.confluence.plugins.restapi.resources.AttachmentResource
@Consumes("application/json")
@Produces("application/json")
@Path("/content/{id}/child/attachment")
public class AttachmentResource
extends Object
CRUD operations for Attachments on Content.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
-
Constructor Summary
ConstructorsConstructorDescriptionAttachmentResource
(AttachmentService attachmentService, AttachmentExtractedTextService attachmentExtractedTextService, SettingsService settingsService) -
Method Summary
Modifier and TypeMethodDescriptioncreateAttachments
(ContentId containerId, ContentStatus containerStatus, boolean allowDuplicated, String expand, List<com.atlassian.plugins.rest.api.multipart.FilePart> fileParts, @Nullable List<com.atlassian.plugins.rest.api.multipart.FilePart> comments, @Nullable List<com.atlassian.plugins.rest.api.multipart.FilePart> minorEdits, @Nullable List<com.atlassian.plugins.rest.api.multipart.FilePart> hiddens) jakarta.ws.rs.core.Response
getAttachmentExtractedText
(ContentId contentId, ContentId attachmentId, long limit) getAttachments
(ContentId contentId, String expand, int start, int limit, String filename, String mediaType, jakarta.ws.rs.core.UriInfo uriInfo) void
jakarta.ws.rs.core.Response
removeAttachment
(ContentId contentId, ContentId attachmentId) jakarta.ws.rs.core.Response
removeAttachmentVersion
(ContentId contentId, ContentId attachmentId, int version) updateData
(ContentId attachmentId, com.atlassian.plugins.rest.api.multipart.FilePart filePart, com.atlassian.plugins.rest.api.multipart.FilePart comment, com.atlassian.plugins.rest.api.multipart.FilePart minorEdit, com.atlassian.plugins.rest.api.multipart.FilePart hidden)
-
Constructor Details
-
AttachmentResource
@Inject public AttachmentResource(AttachmentService attachmentService, AttachmentExtractedTextService attachmentExtractedTextService, SettingsService settingsService)
-
-
Method Details
-
getAttachments
@PublicApi @GET public RestList<Content> getAttachments(@PathParam("id") ContentId contentId, @QueryParam("expand") @DefaultValue("") String expand, @QueryParam("start") int start, @QueryParam("limit") @DefaultValue("50") int limit, @QueryParam("filename") String filename, @QueryParam("mediaType") String mediaType, @Context jakarta.ws.rs.core.UriInfo uriInfo) throws ServiceException - Throws:
ServiceException
-
createAttachments
@PublicApi @POST @Consumes("multipart/form-data") public RestList<Content> createAttachments(@PathParam("id") ContentId containerId, @QueryParam("status") @DefaultValue("current") ContentStatus containerStatus, @QueryParam("allowDuplicated") @DefaultValue("false") boolean allowDuplicated, @QueryParam("expand") @DefaultValue("") String expand, List<com.atlassian.plugins.rest.api.multipart.FilePart> fileParts, @Nullable List<com.atlassian.plugins.rest.api.multipart.FilePart> comments, @Nullable List<com.atlassian.plugins.rest.api.multipart.FilePart> minorEdits, @Nullable List<com.atlassian.plugins.rest.api.multipart.FilePart> hiddens) throws ServiceException - Throws:
ServiceException
-
update
@PublicApi @PUT @Path("/{attachmentId}") public Content update(@PathParam("attachmentId") String attachmentId, Content attachment) throws ServiceException - Throws:
ServiceException
-
updateData
@PublicApi @POST @Path("/{attachmentId}/data") @Consumes("multipart/form-data") public Content updateData(@PathParam("attachmentId") ContentId attachmentId, com.atlassian.plugins.rest.api.multipart.FilePart filePart, com.atlassian.plugins.rest.api.multipart.FilePart comment, com.atlassian.plugins.rest.api.multipart.FilePart minorEdit, com.atlassian.plugins.rest.api.multipart.FilePart hidden) throws ServiceException - Throws:
ServiceException
-
move
@POST @Path("/{attachmentId}/move") public void move(@PathParam("id") ContentId contentId, @PathParam("attachmentId") ContentId attachmentId, @QueryParam("newContentId") ContentId newContentId, @QueryParam("newName") String newName) throws ServiceException - Throws:
ServiceException
-
removeAttachment
@DELETE @Path("/{attachmentId}") public jakarta.ws.rs.core.Response removeAttachment(@PathParam("id") ContentId contentId, @PathParam("attachmentId") ContentId attachmentId) throws ServiceException - Throws:
ServiceException
-
removeAttachmentVersion
@DELETE @Path("/{attachmentId}/version/{version}") public jakarta.ws.rs.core.Response removeAttachmentVersion(@PathParam("id") ContentId contentId, @PathParam("attachmentId") ContentId attachmentId, @PathParam("version") int version) throws ServiceException - Throws:
ServiceException
-
getAttachmentExtractedText
@GET @Path("/{attachmentId}/extractedtext") public jakarta.ws.rs.core.Response getAttachmentExtractedText(@PathParam("id") ContentId contentId, @PathParam("attachmentId") ContentId attachmentId, @QueryParam("limit") long limit) throws ServiceException - Throws:
ServiceException
-