Package org.cxbox.core.file.controller
Interface CxboxFileController
- All Known Implementing Classes:
AbstractCxboxFileController
public interface CxboxFileController
Add
@RestController
@RequestMapping(CXBOX_API_PATH_SPEL + "/file")
on implementation class-
Method Summary
Modifier and TypeMethodDescriptiondefault org.springframework.http.HttpEntity<org.springframework.web.servlet.mvc.method.annotation.StreamingResponseBody>buildFileHttpEntity(InputStream content, Long length, String fileName, String fileType, boolean preview) default longcopy(InputStream inputStream, OutputStream outputStream, int bufferSize) default longcopyLarge(InputStream inputStream, OutputStream outputStream, byte[] buffer) org.springframework.http.HttpEntity<org.springframework.web.servlet.mvc.method.annotation.StreamingResponseBody>Adddefault intdefault 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<org.springframework.web.servlet.mvc.method.annotation.StreamingResponseBody> 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
default org.springframework.http.HttpEntity<org.springframework.web.servlet.mvc.method.annotation.StreamingResponseBody> buildFileHttpEntity(InputStream content, Long length, String fileName, String fileType, boolean preview) -
getChunkSize
default int getChunkSize() -
copy
default long copy(InputStream inputStream, OutputStream outputStream, int bufferSize) throws IOException - Throws:
IOException
-
copyLarge
default long copyLarge(InputStream inputStream, OutputStream outputStream, byte[] buffer) throws IOException - Throws:
IOException
-
getMediaType
-