@NotNull
    private ImmutableTriple<ContentStorage.FileInformation, Integer, Integer> copyAllSecondPassCopyMove(
            final List<ImmutableTriple<ContentStorage.FileInformation, Folder, Integer>> fileList, final boolean move, final Consumer<FolderProcessStatus> statusListener, final AtomicBoolean cancelFlag, final ImmutablePair<Integer, Integer> sourceCopyCount) {

        // -- second pass: make all necessary file copies and create necessary target subfolders
        int dirsCopied = 0;
        int filesCopied = 0;

        ContentStorage.FileInformation failedFile = null;
        for (ImmutableTriple<ContentStorage.FileInformation, Folder, Integer> file : fileList) {
            if (isCancelled(cancelFlag)) {
                break;
            }
            if (file.left.isDirectory) {
                if ((file.right & COPY_FLAG_DIR_BEFORE) > 0) {
                    sendCopyStatus(statusListener, file.left, filesCopied, dirsCopied, sourceCopyCount);
                    if (pls.ensureFolder(file.middle, true)) {
                        dirsCopied++;
                    } else {
                        failedFile = file.left;
                    }
                }
                if (move & file.right == 0 && !pls.delete(file.left.uri)) {
                    failedFile = file.left;
                }
            } else {
                sendCopyStatus(statusListener, file.left, filesCopied, dirsCopied, sourceCopyCount);
                if (pls.copy(file.left.uri, file.middle, FileNameCreator.forName(file.left.name), false) != null) {
                    filesCopied++;
                    if (move && !pls.delete(file.left.uri)) {
                        failedFile = file.left;
                    }
                } else {
                    failedFile = file.left;
                }
            }
            if (failedFile != null) {
                break;
            }
        }
        return new ImmutableTriple<>(failedFile, filesCopied, dirsCopied);
    }
copyAll First Pass: collect all files to copy, create target folder for each file, mark source folders to keep on move (if target is in source)
returns in left the list of files. Returns in right the files/dirs found in source for copying
main/src/main/java/cgeo/geocaching/storage/FolderUtils.java