StatisticsResult () { if (myListener != null) { myListener.onLogsSend(mySuccessfullySentFiles, myErrors, myLocalFiles); } int succeed = mySuccessfullySentFiles.size(); int failed = myErrors.size(); int total = succeed + failed; if (total == 0) { return new StatisticsResult(ResultCode.NOTHING_TO_SEND, "No files to upload."); } else if (failed > 0) { return new StatisticsResult(ResultCode.SENT_WITH_ERRORS, "Uploaded " + succeed + " out of " + total + " files."); } return new StatisticsResult(ResultCode.SEND, "Uploaded " + succeed + " files."); }