@RequestMapping(value = "/{cluster}/source", method = GET, produces = YamlUtils.MIME_TYPE_VALUE) public ResponseEntity<RootSource> getClusterSource(@PathVariable("cluster") String cluster) { RootSource root = sourceService.getClusterSource(cluster); ExtendedAssert.notFound(root, "Can not find cluster with name: " + cluster); HttpHeaders headers = new HttpHeaders(); String confName = com.codeabovelab.dm.common.utils.StringUtils.retainForFileName(cluster); if (confName.isEmpty()) { confName = "config"; } headers.set(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"" + confName + ".json\""); return new ResponseEntity<>(root, headers, HttpStatus.OK); }