This repository has been archived on 2022-03-12. You can view files and clone it, but cannot push or open issues or pull requests.

37 lines
758 B
Mathematica
Raw Permalink Normal View History

2021-04-02 02:24:13 +03:00
// Copyright 2015-present 650 Industries. All rights reserved.
#import <EXFileSystem/EXResumablesManager.h>
@interface EXResumablesManager ()
@property (nonatomic, strong) NSMutableDictionary<NSString *, NSURLSessionDownloadTask *> *resumableDownloads;
@end
@implementation EXResumablesManager
- (instancetype)init
{
if (self = [super init]) {
_resumableDownloads = [NSMutableDictionary dictionary];
}
return self;
}
- (void)registerTask:(NSURLSessionDownloadTask *)task uuid:(NSString *)uuid
{
_resumableDownloads[uuid] = task;
}
- (NSURLSessionDownloadTask * _Nullable)taskForId:(NSString *)uuid
{
return _resumableDownloads[uuid];
}
- (void)unregisterTask:(NSString *)uuid
{
[_resumableDownloads removeObjectForKey:uuid];
}
@end