public B2Client() { _uploadConfigsByBucket = new ConcurrentDictionary<string, ConcurrentBag<B2UploadConfiguration>>(); _uploadConfigsByLargeFile = new ConcurrentDictionary<string, ConcurrentBag<B2UploadPartConfiguration>>(); BucketCache = new B2BucketCacher(); Communicator = new B2Communicator(); }
public B2File SetUploadProgressHandler(B2Communicator.NotifyProgress handler) { _uploadNotifyDelegate = handler; return this; }
public async Task<Stream> DownloadDataAsync(B2Communicator.NotifyProgress progressHandler = null) { ThrowIfNot(B2FileState.Present); if (Action != B2FileAction.Upload) throw new InvalidOperationException("This file is not a file - it's most likely a 'hide' placeholder"); B2DownloadResult res = await _b2Client.Communicator.DownloadFileContent(FileId, notifyProgress: progressHandler); return res.Stream; }
public static Stream DownloadData(this B2File file, B2Communicator.NotifyProgress progressHandler = null) { return Utility.AsyncRunHelper(() => file.DownloadDataAsync(progressHandler)); }