Rest API to return a zip file as download
@RequestMapping(value="/v1/collection_service/response/{appReferenceId}", method=RequestMethod.GET, produces=MediaType.MULTIPART_FORM_DATA_VALUE)
The line in the block is the one that determines that the content should be downloaded as zip.
@RequestMapping(value="/v1/collection_service/response/{appReferenceId}", method=RequestMethod.GET, produces=MediaType.MULTIPART_FORM_DATA_VALUE)
public
ResponseEntity<?> collectionServiceProfile(@PathVariable(value="appReferenceId")
String appReferenceId){
ByteBuffer byteBuffer =
collectionService.getCollectionProfileZip(appReferenceId);
MultiValueMap<String, String> headers = new
LinkedMultiValueMap<>();
headers.add(HttpHeaders.CONTENT_TYPE, "application/zip");
return
new ResponseEntity<>(byteBuffer.array(), headers, HttpStatus.OK);
}
The line in the block is the one that determines that the content should be downloaded as zip.