@Override
        protected FolderProcessResult doInBackgroundInternal(final Void[] params) {
            return this.process.call(ci -> {
                final String filesCopied = ci.filesProcessed < 0 ? "-" : "" + ci.filesProcessed;
                final String filesTotal = ci.filesInSource < 0 ? "-" : plurals(activity, R.plurals.file_count, ci.filesInSource);
                final String foldersCopied = ci.dirsProcessed < 0 ? "-" : "" + ci.dirsProcessed;
                final String foldersTotal = ci.dirsInSource < 0 ? "-" : plurals(activity, R.plurals.folder_count, ci.dirsInSource);

                final String statusString = activity.getString(R.string.folder_process_status_done, filesCopied, filesTotal, foldersCopied, foldersTotal);
                final String progressString = activity.getString(R.string.folder_process_status_currentfile, ci.currentFile == null || ci.currentFile.name == null ? "" : ci.currentFile.name);
                publishProgress(statusString + "\n" + progressString);
            });
        }
Returns a pair of longs where left one is free space in bytes and right one is number of files
main/src/main/java/cgeo/geocaching/storage/FolderUtils.java