Class AttachmentsController<T extends SocialUgc>
- java.lang.Object
-
- org.craftercms.social.controllers.rest.v3.comments.AbstractCommentsController
-
- org.craftercms.social.controllers.rest.v3.comments.AttachmentsController<T>
-
@Controller public class AttachmentsController<T extends SocialUgc> extends AbstractCommentsController
-
-
Field Summary
Fields Modifier and Type Field Description protected org.springframework.core.io.Resource
mimeFile
-
Fields inherited from class org.craftercms.social.controllers.rest.v3.comments.AbstractCommentsController
notificationService, socialServices, ugcService
-
-
Constructor Summary
Constructors Constructor Description AttachmentsController()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.craftercms.commons.mongo.FileInfo
addAttachment(@NotBlank String id, org.springframework.web.multipart.MultipartFile attachment)
Iterable<org.craftercms.commons.mongo.FileInfo>
listAttachments(@NotBlank String id)
void
readAttachment(@NotBlank String id, @NotBlank String attachmentId, javax.servlet.http.HttpServletResponse response)
boolean
removeAttachment(@NotBlank String id, @NotBlank String attachmentId)
boolean
removeAttachmentPost(@NotBlank String id, @NotBlank String attachmentId)
boolean
updateAttachmentPost(@NotBlank String id, @NotBlank String attachmentId, org.springframework.web.multipart.MultipartFile file)
-
Methods inherited from class org.craftercms.social.controllers.rest.v3.comments.AbstractCommentsController
context, getContentType, getCurrentProfile, parseAttributes, userId
-
-
-
-
Method Detail
-
addAttachment
@RequestMapping(value="/{id}/attachments", method=POST) @ResponseBody public org.craftercms.commons.mongo.FileInfo addAttachment(@NotBlank @PathVariable("id") @NotBlank String id, @RequestParam org.springframework.web.multipart.MultipartFile attachment) throws SocialException, IOException
- Throws:
SocialException
IOException
-
removeAttachment
@RequestMapping(value="/{id}/attachments/{attachmentId}", method=DELETE) @ResponseBody public boolean removeAttachment(@NotBlank @PathVariable("id") @NotBlank String id, @NotBlank @PathVariable("attachmentId") @NotBlank String attachmentId) throws SocialException, IOException
- Throws:
SocialException
IOException
-
removeAttachmentPost
@RequestMapping(value="/{id}/attachments/{attachmentId}/delete", method=POST) @ResponseBody public boolean removeAttachmentPost(@NotBlank @PathVariable("id") @NotBlank String id, @NotBlank @PathVariable("attachmentId") @NotBlank String attachmentId) throws SocialException, IOException
- Throws:
SocialException
IOException
-
updateAttachmentPost
@RequestMapping(value="/{id}/attachments/{attachmentId}/update", method=POST) @ResponseBody public boolean updateAttachmentPost(@NotBlank @PathVariable("id") @NotBlank String id, @NotBlank @PathVariable("attachmentId") @NotBlank String attachmentId, @RequestParam org.springframework.web.multipart.MultipartFile file) throws SocialException, IOException
- Throws:
SocialException
IOException
-
listAttachments
@RequestMapping(value="/{id}/attachments", method=GET) @ResponseBody public Iterable<org.craftercms.commons.mongo.FileInfo> listAttachments(@NotBlank @PathVariable("id") @NotBlank String id) throws SocialException, UGCNotFound
- Throws:
SocialException
UGCNotFound
-
readAttachment
@RequestMapping(value="/{id}/attachments/{attachmentId}", method=GET) @ResponseBody public void readAttachment(@NotBlank @PathVariable("id") @NotBlank String id, @NotBlank @PathVariable("attachmentId") @NotBlank String attachmentId, javax.servlet.http.HttpServletResponse response) throws SocialException, IOException
- Throws:
SocialException
IOException
-
-