SHARE
TWEET

Untitled

a guest Jan 21st, 2020 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public long getFolderSize(File file, long size) {    // size has to be 0 at the beginning
  2.     size += file.length();
  3.     if (file.isDirectory()) {
  4.         for (File child : file.listFiles()) {
  5.             getFolderSize(child, size);
  6.         }
  7.     }
  8.     return size;
  9. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top