@Controller public class AttachmentsController<T extends SocialUgc> extends AbstractCommentsController
notificationService, socialServices, ugcService| Constructor and Description |
|---|
AttachmentsController() |
| Modifier and Type | Method and Description |
|---|---|
org.craftercms.commons.mongo.FileInfo |
addAttachment(String id,
org.springframework.web.multipart.commons.CommonsMultipartFile attachment) |
Iterable<org.craftercms.commons.mongo.FileInfo> |
listAttachments(String id) |
void |
readAttachment(String id,
String attachmentId,
javax.servlet.http.HttpServletResponse response) |
boolean |
removeAttachment(String id,
String attachmentId) |
boolean |
updateAttachment(String id,
String attachmentId,
org.springframework.web.multipart.commons.CommonsMultipartFile file) |
context, getContentType, getCurrentProfile, parseAttributes, userId@RequestMapping(value="/{id}/attachments",
method=POST)
@ResponseBody
public org.craftercms.commons.mongo.FileInfo addAttachment(@NotBlank@PathVariable(value="id")
String id,
@RequestParam(required=true)
org.springframework.web.multipart.commons.CommonsMultipartFile attachment)
throws SocialException,
IOException
SocialExceptionIOException@RequestMapping(value="/{id}/attachments/{attachmentId}",
method=DELETE)
@ResponseBody
public boolean removeAttachment(@NotBlank@PathVariable(value="id")
String id,
@NotBlank@PathVariable(value="attachmentId")
String attachmentId)
throws SocialException,
IOException
SocialExceptionIOException@RequestMapping(value="/{id}/attachments/{attachmentId}",
method=PUT)
@ResponseBody
public boolean updateAttachment(@NotBlank@PathVariable(value="id")
String id,
@NotBlank@PathVariable(value="attachmentId")
String attachmentId,
org.springframework.web.multipart.commons.CommonsMultipartFile file)
throws SocialException,
IOException
SocialExceptionIOException@RequestMapping(value="/{id}/attachments",
method=GET)
@ResponseBody
public Iterable<org.craftercms.commons.mongo.FileInfo> listAttachments(@NotBlank@PathVariable(value="id")
String id)
throws SocialException,
UGCNotFound
SocialExceptionUGCNotFound@RequestMapping(value="/{id}/attachments/{attachmentId}",
method=GET)
@ResponseBody
public void readAttachment(@NotBlank@PathVariable(value="id")
String id,
@NotBlank@PathVariable(value="attachmentId")
String attachmentId,
javax.servlet.http.HttpServletResponse response)
throws SocialException,
IOException
SocialExceptionIOExceptionCopyright © 2014 CrafterCMS. All Rights Reserved.