diff --git a/src/main/java/com/lpvs/util/LPVSFileUtil.java b/src/main/java/com/lpvs/util/LPVSFileUtil.java index 0eed4846..43a5ada0 100644 --- a/src/main/java/com/lpvs/util/LPVSFileUtil.java +++ b/src/main/java/com/lpvs/util/LPVSFileUtil.java @@ -151,7 +151,12 @@ public static void copyFiles(String sourcePath, String directoryPath) throws IOE StandardCopyOption.REPLACE_EXISTING); } else if (file.isDirectory()) { File destinationSubdir = new File(destination, file.getName()); - destinationSubdir.mkdirs(); + boolean isCreated = destinationSubdir.mkdirs(); + if (!isCreated) { + throw new IOException( + "Failed to create directory: " + + destinationSubdir.getAbsolutePath()); + } copyFiles(file.getAbsolutePath(), destinationSubdir.getAbsolutePath()); } }