List of utility methods to do Folder Size Get
long | getSize(final File path) Gets the size of the path. long size = 0; if (path.isFile()) { size = path.length(); } else { File[] subFiles = path.listFiles(); for (File file : subFiles) { if (file.isFile()) { size += file.length(); ... |
long | getFolderSize(java.io.File file) get Folder Size long size = 0; java.io.File[] fileList = file.listFiles(); for (int i = 0; i < fileList.length; i++) { if (fileList[i].isDirectory()) { size = size + getFolderSize(fileList[i]); } else { size = size + fileList[i].length(); return size / 1024; |
long | getFolderSize(File file) get Folder Size long size = 0; File[] fileList = file.listFiles(); for (int i = 0; i < fileList.length; i++) { if (fileList[i].isDirectory()) { size = size + getFolderSize(fileList[i]); } else { size = size + fileList[i].length(); return size; |