mirror of
https://github.com/nextcloud/android.git
synced 2024-11-29 02:38:58 +03:00
changes due to CR
Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
This commit is contained in:
parent
191a55a825
commit
84e9519807
1 changed files with 12 additions and 8 deletions
|
@ -217,16 +217,20 @@ public class FileStorageUtils {
|
|||
* @return Size in bytes
|
||||
*/
|
||||
public static long getFolderSize(File dir) {
|
||||
if (dir.exists() && dir.isDirectory() && dir.listFiles() != null) {
|
||||
long result = 0;
|
||||
for (File f : dir.listFiles()) {
|
||||
if (f.isDirectory()) {
|
||||
result += getFolderSize(f);
|
||||
} else {
|
||||
result += f.length();
|
||||
if (dir.exists() && dir.isDirectory()) {
|
||||
File[] files = dir.listFiles();
|
||||
|
||||
if (files != null) {
|
||||
long result = 0;
|
||||
for (File f : files) {
|
||||
if (f.isDirectory()) {
|
||||
result += getFolderSize(f);
|
||||
} else {
|
||||
result += f.length();
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue