public void Initialize(DownloadManagerConfiguration configuration) { _configuration = configuration; DownloadDetailsCache.Instance.Configure(configuration); DownloadDetailsCache.Instance.Restore(); }
private DocumentFile RequestStoragePermission(DownloadManagerConfiguration configuration, string rootDirectory) { lock (PermissionRequestSynchronizer) { return(configuration.StoragePermissionsHandler.RequestStoragePermission(rootDirectory)); } }
public void ResumeDownloadTask(DownloadManagerConfiguration configuration, DownloadDetails downloadDetails) { if (_downloadTasks.TryRemove(downloadDetails, out var downloadTask)) { downloadTask.Abort(); } downloadTask = new Thread(OnDownloadTaskStarted); _downloadTasks.AddOrUpdate(downloadDetails, downloadTask, (details, thread) => downloadTask); downloadTask.Start(new object[] { configuration, downloadDetails, true }); }
internal void Configure(DownloadManagerConfiguration configuration) { _configuration = configuration; }
public static DocumentFileStream Create(DownloadManagerConfiguration configuration, DocumentFile file) { return(new DocumentFileStream(configuration, file)); }
private Stream CreateStream(DownloadManagerConfiguration configuration, DocumentFile file) { // The file is appended thus no need to use an offset. return(configuration.Context.ContentResolver.OpenOutputStream(file.Uri, "wa")); }
private DocumentFileStream(DownloadManagerConfiguration configuration, DocumentFile file) { _stream = CreateStream(configuration, file); }