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:preparationBlock:priority:completionHandler:

Download a file.

+ (void)downloadFileAtURL:(nonnull NSURL *)url toFilePath:(nonnull NSString *)filePath preparationBlock:(nullable NSData *_Nonnull ( ^ ) ( NSData *_Nonnull 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.

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:(nonnull 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.

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

Parameters

fileName

name of the file.

Return Value

full path for a file in the Bit6 cache directory.

Declared In

Bit6FileDownloader.h