From 8b5fb97e40c33573d7b236e1f332ba6d6e90456c Mon Sep 17 00:00:00 2001 From: Oleg Kopysov Date: Wed, 14 Aug 2024 09:29:29 +0300 Subject: [PATCH] fix: Fix Svace issue with ignored check (#572) fix: Fix Svace issue with ignorred check Signed-off-by: Oleg Kopysov --- src/main/java/com/lpvs/util/LPVSFileUtil.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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()); } }