private void calculateUploadedAndTotalBytes ( ) { uploadedBytes = 0 ; for ( String filePath : getSuccessfullyUploadedFiles ( ) ) { uploadedBytes += new File ( filePath ) . length ( ) ; } totalBytes = uploadedBytes ; for ( UploadFile file : params . files ) { totalBytes += file . length ( service ) ; } }
Calculates the total bytes of this upload task . This the sum of all the lengths of the successfully uploaded files and also the pending ones .