From 70537346f412db81e7b837ef00706ff7bd5b1fbd Mon Sep 17 00:00:00 2001 From: Luke Sikina Date: Fri, 10 Nov 2023 12:14:14 -0500 Subject: [PATCH] check --- .../avillach/hpds/service/filesharing/FileSystemService.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/service/src/main/java/edu/harvard/hms/dbmi/avillach/hpds/service/filesharing/FileSystemService.java b/service/src/main/java/edu/harvard/hms/dbmi/avillach/hpds/service/filesharing/FileSystemService.java index 2277bf2a..ae31f04a 100644 --- a/service/src/main/java/edu/harvard/hms/dbmi/avillach/hpds/service/filesharing/FileSystemService.java +++ b/service/src/main/java/edu/harvard/hms/dbmi/avillach/hpds/service/filesharing/FileSystemService.java @@ -36,7 +36,9 @@ public boolean writeResultToFile(String fileName, String directory, AsyncResult try { LOG.info("Writing query {} to file: {}", result.id, filePath); - Files.createDirectory(dirPath); + if (!Files.exists(dirPath)) { + Files.createDirectory(dirPath); + } result.stream.open(); return Files.copy(result.stream, filePath) > 0; } catch (IOException e) {