class DataSetDownloadController {

    @GetMapping(value = "/dataset/export")
    @ResponseBody
    public ResponseEntity<Resource> exportDataSet() throws IOException {
        String dataSet = demoService.exportDataSet();
        byte[] dataSetBytes = dataSet.getBytes(StandardCharsets.UTF_8);
        try (InputStream is = new ByteArrayInputStream(dataSetBytes)) {
            HttpHeaders headers = new HttpHeaders();
            ContentDisposition attachment = ContentDisposition.builder("attachment")
                    .filename("vrp_data_set.yaml")
                    .build();
            headers.setContentDisposition(attachment);
            return ResponseEntity.ok()
                    .headers(headers)
                    .contentLength(dataSetBytes.length)
                    .contentType(new MediaType("text", "x-yaml", StandardCharsets.UTF_8))
                    .body(new InputStreamResource(is));
        }
    }

      DataSetDownloadController(DemoService demoService);

}