From 3ef1be64da632d795582ed15782e224a91dae63c Mon Sep 17 00:00:00 2001
From: Phillipus
Date: Tue, 27 Feb 2024 17:16:48 +0000
Subject: [PATCH] FileUtils isFolderEmpty should throw IOException
- And this also eliminates a warning in Eclipse 4.31 about a potential resource leak
---
.../src/com/archimatetool/editor/utils/FileUtils.java | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/com.archimatetool.editor/src/com/archimatetool/editor/utils/FileUtils.java b/com.archimatetool.editor/src/com/archimatetool/editor/utils/FileUtils.java
index dd8c541ce..bff1f8108 100644
--- a/com.archimatetool.editor/src/com/archimatetool/editor/utils/FileUtils.java
+++ b/com.archimatetool.editor/src/com/archimatetool/editor/utils/FileUtils.java
@@ -416,7 +416,7 @@ public static String getValidFileName(String name) {
* @param folder
* @return true if the folder is empty
*/
- public static boolean isFolderEmpty(File folder) {
+ public static boolean isFolderEmpty(File folder) throws IOException {
if(!(folder != null && folder.exists() && folder.isDirectory())) {
return true;
}
@@ -426,9 +426,6 @@ public static boolean isFolderEmpty(File folder) {
.filter(path -> !path.endsWith(".DS_Store"))) { // Ignore Mac file
return entries.findFirst().isEmpty();
}
- catch(IOException ex) {
- return true;
- }
}
}