Digital Marketing

How To Check If Directory Is Empty In Java

With JDK >= 7 you can use Files.newDirectoryStream to open the directory and then use the iterator's hasNext() method to test there are any files to iterator over. This should work better for huge directories or where the directory is on a remote file system when compared to the java.io.File list methods.

Popular posts from this blog

How to fix Google Apps Script: Script function not found: doGet

Creating sort index in MySQL

How to fix: df shows no file systems processed on Linux