AlgoDataFile

public class AlgoDataFile:AlgoDataObject

Object to file in the data API

  • Get data from this file as string using UTF-8 charset, @warning It return error in handler if data is not UTF-8 charset.

    • string: string that is decoded as utf-8 charset
    • error: An error object that indicates why the request failed, or nil if the request was successful.

    Declaration

    Swift

    public func getString(completion:@escaping (String?, Error?) -> Void)

    Parameters

    completion

    completion handler. It takes two parameter

  • Get data from this file as binary

    • data: data object
    • error: An error object that indicates why the request failed, or nil if the request was successful.

    Declaration

    Swift

    public func getData(completion:@escaping (Data?, Error?) -> Void)

    Parameters

    completion

    completion handler. It takes two parameter

  • Download file into local storage

    • url: url of local file
    • error: An error object that indicates why the request failed, or nil if the request was successful.

    Declaration

    Swift

    public func getFile(completion:@escaping AlgoDownloadCompletionHandler)

    Parameters

    completion

    completion handler. It takes two parameter

  • Upload binary data into file on server

    • error: An error object that indicates why the request failed, or nil if the request was successful.

    Declaration

    Swift

    public func put(data:Data, completion:@escaping (Error?) -> Void)

    Parameters

    data

    data object

    completion

    completion handler. It takes one parameter

  • Upload string(UTF-8) to file on server

    • error: An error object that indicates why the request failed, or nil if the request was successful.

    Declaration

    Swift

    public func put(string:String, completion:@escaping (Error?) -> Void)

    Parameters

    string

    string object

    completion

    completion handler. It takes one parameter

  • Upload local file to server

    • error: An error object that indicates why the request failed, or nil if the request was successful.

    Declaration

    Swift

    public func put(file:URL, completion:@escaping (Error?) -> Void)

    Parameters

    file

    url of local file

    completion

    completion handler. It takes one parameter

  • Delete file on server

    • error: An error object that indicates why the request failed, or nil if the request was successful.

    Declaration

    Swift

    public func delete(completion:@escaping (Error?) -> Void)

    Parameters

    completion

    completion handler. It takes one parameter