diff --git a/src/main/java/com/powsybl/caseserver/CaseController.java b/src/main/java/com/powsybl/caseserver/CaseController.java index ac88abc..0e1d6e3 100644 --- a/src/main/java/com/powsybl/caseserver/CaseController.java +++ b/src/main/java/com/powsybl/caseserver/CaseController.java @@ -131,9 +131,10 @@ public ResponseEntity downloadCase(@PathVariable("caseUuid") UUID caseUu public ResponseEntity exportCase( @PathVariable UUID caseUuid, @RequestParam String format, + @RequestParam(value = "fileName", required = false) String fileName, @RequestBody(required = false) Map formatParameters) throws IOException { LOGGER.debug("exportCase request received with parameter caseUuid = {}", caseUuid); - return caseService.exportCase(caseUuid, format, formatParameters).map(networkInfos -> { + return caseService.exportCase(caseUuid, format, fileName, formatParameters).map(networkInfos -> { var headers = new HttpHeaders(); headers.setContentDisposition( ContentDisposition.builder("attachment") diff --git a/src/main/java/com/powsybl/caseserver/service/CaseService.java b/src/main/java/com/powsybl/caseserver/service/CaseService.java index bd96ca7..1cd3ca6 100644 --- a/src/main/java/com/powsybl/caseserver/service/CaseService.java +++ b/src/main/java/com/powsybl/caseserver/service/CaseService.java @@ -99,7 +99,7 @@ default byte[] createZipFile(Collection names, MemDataSource dataSource) } } - default Optional exportCase(UUID caseUuid, String format, Map formatParameters) throws IOException { + default Optional exportCase(UUID caseUuid, String format, String fileName, Map formatParameters) throws IOException { if (!Exporter.getFormats().contains(format)) { throw CaseException.createUnsupportedFormat(format); } @@ -117,17 +117,17 @@ default Optional exportCase(UUID caseUuid, String format, Map