0

Java – Get a directory’s size

There are few ways to get a directory’s size.

Solution 1

Sum up all the files’ size in the directory.

Solution 2

Java 7 style

Solution 3

Java 8 style

Karl San Gabriel

Karl San Gabriel

Java and Enterprise Technologies Expert