How to get size of a directory in Java
In Java, we can use Files.size to get the size of a file; for the directory or folder size, we need to count the size of a directory recursively (sum of the Files.size of all files). This example shows a few common ways to get the size of a directory or folder. FileVisitor (Java 7) …