Don't infer anything from existence of (possibly empty) DB directory.

This commit is contained in:
akwizgran
2020-02-24 17:48:54 +00:00
parent 421f0ebfa5
commit 618ab1f1ec
5 changed files with 16 additions and 53 deletions

View File

@@ -117,4 +117,10 @@ public class IoUtils {
throw new IOException(e);
}
}
public static boolean isNonEmptyDirectory(File f) {
if (!f.isDirectory()) return false;
File[] children = f.listFiles();
return children != null && children.length > 0;
}
}