PCloudAPIDownloadTaskBuilder
public struct PCloudAPIDownloadTaskBuilder
Utility struct containing logic for building DownloadTask instances.
-
Undocumented
Declaration
Swift
public init(hostProvider: HostProvider, authenticator: Authenticator, defaultTimeoutInterval: TimeInterval? = nil, operationBuilder: @escaping (Download.Request) -> DownloadOperation) -
Creates a
DownloadTaskinstance for downloading a file from a remote address.Declaration
Swift
public func createTask(with resourceAddress: URL, downloadTag: String? = nil, timeoutInterval: TimeInterval? = nil, destination: @escaping (URL) throws -> URL) -> DownloadTaskParameters
resourceAddressThe location of the file to download.
downloadTagTo be passed alongside
FileLink.Metadataresource addresses. Authenticates this client to the storage servers.timeoutIntervalThe timeout interval for this call task. If
nil, the default timeout interval will be used.destinationA block called with the temporary location of the file on disk. The block must either move the file or open it for reading, otherwise the file gets deleted after the block returns. The block should return the new path of the file.
Return Value
An instance of
DownloadTaskin suspended state.
View on GitHub
PCloudAPIDownloadTaskBuilder Structure Reference