Loading src/main/java/it/inaf/ia2/transfer/controller/PutFileController.java +9 −3 Original line number Diff line number Diff line Loading @@ -83,11 +83,17 @@ public class PutFileController { File file = path.toFile(); /** * This block must be synchronized, to avoid concurrency issues when * multiple files are uploaded to a new folder in parallel. */ synchronized (this) { if (!file.getParentFile().exists()) { if (!file.getParentFile().mkdirs()) { throw new IllegalStateException("Unable to create parent folder: " + file.getParentFile().getAbsolutePath()); } } } Files.copy(is, file.toPath()); } Loading Loading
src/main/java/it/inaf/ia2/transfer/controller/PutFileController.java +9 −3 Original line number Diff line number Diff line Loading @@ -83,11 +83,17 @@ public class PutFileController { File file = path.toFile(); /** * This block must be synchronized, to avoid concurrency issues when * multiple files are uploaded to a new folder in parallel. */ synchronized (this) { if (!file.getParentFile().exists()) { if (!file.getParentFile().mkdirs()) { throw new IllegalStateException("Unable to create parent folder: " + file.getParentFile().getAbsolutePath()); } } } Files.copy(is, file.toPath()); } Loading