How to Calculate Folder Size in Java

You may also like...

2
Leave a Reply

avatar
2 Comment threads
0 Thread replies
1 Followers
 
Most reacted comment
Hottest comment thread
2 Comment authors
Rainer Hoffhost Recent comment authors
  Subscribe  
newest oldest
Notify of
host
Guest
host

Hmm, you use recursion. It is not use for large Directory tree. Better is implement SimpleFileVisitor from Java.nio

Rainer Hoff
Guest
Rainer Hoff

This is one of the most clever solutions to this problem that I’ve seen. I implemented this and tested accuracy for folders up to 20GB–100% correct in each case. I haven’t had the opportunity to test larger data sets.
Thanks again!