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.
  • Constructor Details

  • 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 javax.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 javax.ws.rs.core.Response removeAttachment(@PathParam("id") ContentId contentId, @PathParam("attachmentId") ContentId attachmentId) throws ServiceException
      Throws:
      ServiceException
    • removeAttachmentVersion

      @DELETE @Path("/{attachmentId}/version/{version}") public javax.ws.rs.core.Response removeAttachmentVersion(@PathParam("id") ContentId contentId, @PathParam("attachmentId") ContentId attachmentId, @PathParam("version") int version) throws ServiceException
      Throws:
      ServiceException