/** * compute the recursive file size of all the files in the list. Folder * have a weight of 1. * @param entries * @param fls * @return */ private int getTotalRemoteFileSize(FileEntry[] entries, FileListingService fls) { int count = 0; for (FileEntry e : entries) { int type = e.getType(); if (type == FileListingService.TYPE_DIRECTORY) { // get the children FileEntry[] children = fls.getChildren(e, false, null); count += getTotalRemoteFileSize(children, fls) + 1; } else if (type == FileListingService.TYPE_FILE) { count += e.getSizeValue(); } } return count; }
/** * compute the recursive file size of all the files in the list. Folder * have a weight of 1. * @param entries * @param fls * @return */ private int getTotalRemoteFileSize(FileEntry[] entries, FileListingService fls) { int count = 0; for (FileEntry e : entries) { int type = e.getType(); if (type == FileListingService.TYPE_DIRECTORY) { // get the children FileEntry[] children = fls.getChildren(e, false, null); count += getTotalRemoteFileSize(children, fls) + 1; } else if (type == FileListingService.TYPE_FILE) { count += e.getSizeValue(); } } return count; }
int total = getTotalRemoteFileSize(entries, fls);
int total = getTotalRemoteFileSize(entries, fls);