Android Utililty Methods Folder Size Get

List of utility methods to do Folder Size Get

Description

The list of methods to do Folder Size Get are organized into topic(s).

Method

longgetSize(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();
...
longgetFolderSize(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;
longgetFolderSize(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;