You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by hx...@apache.org on 2020/02/18 05:57:32 UTC

[incubator-iotdb] 02/02: print which files are left after cleaning a folder

This is an automated email from the ASF dual-hosted git repository.

hxd pushed a commit to branch ut_close_socket
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git

commit 5cde236271f0e8320db1752ddb994658c14801d5
Author: xiangdong huang <sa...@gmail.com>
AuthorDate: Tue Feb 18 13:57:12 2020 +0800

    print which files are left after cleaning a folder
---
 server/src/main/java/org/apache/iotdb/db/utils/FileUtils.java | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/server/src/main/java/org/apache/iotdb/db/utils/FileUtils.java b/server/src/main/java/org/apache/iotdb/db/utils/FileUtils.java
index 340ef49..60f17ff 100644
--- a/server/src/main/java/org/apache/iotdb/db/utils/FileUtils.java
+++ b/server/src/main/java/org/apache/iotdb/db/utils/FileUtils.java
@@ -21,8 +21,10 @@ package org.apache.iotdb.db.utils;
 
 import java.io.File;
 import java.io.IOException;
+import java.nio.file.DirectoryNotEmptyException;
 import java.nio.file.Files;
 import java.nio.file.NoSuchFileException;
+import java.util.Arrays;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -38,8 +40,8 @@ public class FileUtils {
     }
     try {
       Files.delete(folder.toPath());
-    } catch (NoSuchFileException e) {
-      logger.warn(e.getMessage(), e);
+    } catch (NoSuchFileException | DirectoryNotEmptyException e) {
+      logger.warn(Arrays.toString(folder.list()), e);
     }
   }
 }