changes due to CR

Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
This commit is contained in:
tobiasKaminsky 2018-03-15 12:25:37 +01:00 committed by AndyScherzinger
parent 191a55a825
commit 84e9519807
No known key found for this signature in database
GPG key ID: 6CADC7E3523C308B

View file

@ -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;
}