Interface CxboxFileController

All Known Implementing Classes:
AbstractCxboxFileController

public interface CxboxFileController
Add

 @RestController
 @RequestMapping(CXBOX_API_PATH_SPEL + "/file")
 
on implementation class
  • Method Details

    • upload

      CxboxResponseDTO<? extends FileUploadDto> upload(@RequestParam("file") org.springframework.web.multipart.MultipartFile file, @RequestParam(value="source",required=false) String source)
      Add
      
       @PostMapping(consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
       
      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
    • 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
      
       @GetMapping
       
      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
    • remove

      CxboxResponseDTO<Void> remove(@RequestParam("id") String id, @RequestParam("source") String source)
      Add
      
       @DeleteMapping
       
      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
    • 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

      default org.springframework.http.MediaType getMediaType(String type)