Package org.cxbox.core.file.controller
Interface CxboxFileController
- All Known Implementing Classes:
CxboxFileControllerSimple
public interface CxboxFileController
Add
@RestController
@RequestMapping(CXBOX_API_PATH_SPEL + "/file")
on implementation class-
Method Summary
Modifier and TypeMethodDescriptiondefault org.springframework.http.HttpEntity<byte[]>buildFileHttpEntity(byte[] content, String fileName, String fileType, boolean inline) org.springframework.http.HttpEntity<byte[]>Adddefault org.springframework.http.MediaTypegetMediaType(String type) AddCxboxResponseDTO<? extends FileUploadDto>Add
-
Method Details
-
upload
CxboxResponseDTO<? extends FileUploadDto> upload(@RequestParam("file") org.springframework.web.multipart.MultipartFile file, @RequestParam(value="source",required=false) String source) Add
on implementation class. You can extend api for /file endpoint (declaring method with another signature), so we are not placing @PostMapping on interface to avoid endpoints clash@PostMapping(consumes = MediaType.MULTIPART_FORM_DATA_VALUE) -
download
org.springframework.http.HttpEntity<byte[]> download(@RequestParam("id") String id, @RequestParam(value="source",required=false) String source, @RequestParam(value="preview",required=false,defaultValue="false") boolean preview) Add
on implementation class. You can extend api for /file endpoint (declaring method with another signature), so we are not placing @PostMapping on interface to avoid endpoints clash. See buildFileHttpEntity example of constructing response for this method@GetMapping -
remove
Add
on implementation class. You can extend api for /file endpoint (declaring method with another signature), so we are not placing @PostMapping on interface to avoid endpoints clash@DeleteMapping -
buildFileHttpEntity
-
getMediaType
-