private Worker.Result handleMapFile(final Context context, final NotificationManagerCompat notificationManager, final NotificationCompat.Builder notification, final Runnable updateForegroundNotification,
                               final boolean isZipFile, final String nameWithinZip) {
        // try to preserve displayName (if download supports that)
        String displayName = "";
        if (downloader.useCompanionFiles && StringUtils.isNotBlank(sourceURL)) {
            final AbstractDownloader downloader = Download.DownloadType.getInstance(offlineMapTypeId);
            final CompanionFileUtils.DownloadedFileData old = downloader == null ? null : CompanionFileUtils.readData(downloader.targetFolder.getFolder(), filename + CompanionFileUtils.INFOFILE_SUFFIX);
            if (old != null && StringUtils.isNotBlank(old.displayName)) {
                displayName = old.displayName;
            }
        }

        cleanupFolder();

        Worker.Result resultId = Worker.Result.failure();
        final String resultMsg;

        String fileinfo = filename;
        if (fileinfo != null) {
            fileinfo = fileinfo.substring(0, fileinfo.length() - downloader.forceExtension.length());
        }

        // do some integrity checks (if supported by file type)
        final CopyStates status;
        if (!downloader.verifiedBeforeCopying(filename, uri)) {
            status = CopyStates.INTEGRITY_CHECK_ERROR;
        } else {
            // now start copy task
            status = copyInternal(context, notification, updateForegroundNotification, isZipFile, nameWithinZip, downloader.downloadHasExtraContents);
        }
        switch (status) {
            case SUCCESS:
                resultMsg = String.format(context.getString(R.string.receivedownload_success), fileinfo);
                if (downloader.useCompanionFiles && StringUtils.isNotBlank(sourceURL)) {
                    CompanionFileUtils.writeInfo(sourceURL, filename, StringUtils.isNotBlank(displayName) ? displayName : CompanionFileUtils.getDisplayName(fileinfo), sourceDate, offlineMapTypeId);
                }
                TileProviderFactory.buildTileProviderList(true);
                resultId = Worker.Result.success();
                break;
            case CANCELLED:
                resultMsg = context.getString(R.string.receivedownload_cancelled);
                break;
            case IO_EXCEPTION:
                resultMsg = String.format(context.getString(R.string.receivedownload_error_io_exception), downloader.targetFolder.toUserDisplayableValue());
                break;
            case FILENOTFOUND_EXCEPTION:
                resultMsg = context.getString(R.string.receivedownload_error_filenotfound_exception);
                break;
            case INTEGRITY_CHECK_ERROR:
                resultMsg = context.getString(R.string.receivedownload_integritycheck_failed);
                break;
            default:
                resultMsg = context.getString(R.string.receivedownload_error);
                break;
        }
        notificationManager.notify(Settings.getUniqueNotificationId(), Notifications.createTextContentNotification(
                context, NotificationChannels.DOWNLOADER_RESULT_NOTIFICATION, R.string.receivedownload_intenttitle, resultMsg
        ).build());
        return resultId;
    }
receives a file downloaded with system's DownloadManager, copying it to the appropriate c:geo folder
called internally by {@link ReceiveDownloadService} or {@link ReceiveDownloadWorker}
main/src/main/java/cgeo/geocaching/downloader/ReceiveDownload.java