Inherits from NSObject
Declared in Bit6FileDownloader.h

Overview

Bit6FileDownloader handles the downloads of the framework using NSOperationQueue and NSURLSessionDownloadTask.

Class Methods

cancelOperations

Cancels all pending download operations.

+ (void)cancelOperations

Declared In

Bit6FileDownloader.h

downloadFileAtURL:toFilePath:canReplace:preparationBlock:priority:completionHandler:

Download a file. It can be set to replace any file in the indicated path if necessary. When running from an extension, a copy of the file will be saved in the SDK group container.

+ (void)downloadFileAtURL:(NSURL *)url toFilePath:(NSString *)filePath canReplace:(BOOL)replace preparationBlock:(nullable NSData *( ^ ) ( NSData *data ))preparationBlock priority:(NSOperationQueuePriority)priority completionHandler:(nullable void ( ^ ) ( NSURL *_Nullable location , NSURLResponse *_Nullable response , NSError *_Nullable error ))completionHandler

Parameters

url

remote URL address of the file to download.

filePath

local path where to save the file.

replace

the file will be downloaded and will replace the file in cache.

preparationBlock

block to process the downloaded data before saving it to the filePath.

priority

the execution priority of the operation in the operation queue.

completionHandler

Block to call after the operation has been completed. The “error” value can be use to know if the file was downloaded and saved in cache.

Declared In

Bit6FileDownloader.h

isDownloadingFileAtURL:

Query is a URL is being downloaded.

+ (BOOL)isDownloadingFileAtURL:(NSURL *)url

Parameters

url

remote URL address of the file.

Return Value

true if the specified URL is being downloaded.

Declared In

Bit6FileDownloader.h

pathForFileName:

Get the full path for a file in the ~/Cache/bit6 directory.

+ (NSString *)pathForFileName:(NSString *)fileName

Parameters

fileName

name of the file.

Return Value

full path for a file in the Bit6 cache directory.

Declared In

Bit6FileDownloader.h