Filespec

public struct Filespec : Codable

Filespec expected to store a file related information that could be not available after how a file was downloaded. Filespec object could be stored in .json format representation.

Filespec can be useful in some situations, for example, let say you have a path to a local file, but you also want to know from where that file was downloaded.

  • url

    url** from where the file was downloaded

    Declaration

    Swift

    public var url: URL?
  • directoryPath** where the file is located in the device

    Declaration

    Swift

    public var directoryPath: String?
  • original given name to the file

    Declaration

    Swift

    public var name: String?
  • filename** that stores in the device

    Declaration

    Swift

    public var filename: String?
  • File’s extention

    Declaration

    Swift

    public var fileExtension: String?
  • File size, in bytes

    Declaration

    Swift

    public var size: Int64?
  • The location of the directory in the Application sandbox

    Declaration

    Swift

    public var searchPathDirectoryId: UInt?
  • full path where the file is located in the device

    Declaration

    Swift

    var path: String? { get }
  • Data** representation of Filespec in JSON format

    Declaration

    Swift

    var jsonData: Data? { get }
  • Initialization of Filespec

    Declaration

    Swift

    init?(fromJsonData jsonData: Data)

    Parameters

    jsonData

    Data that represent Filespec in JSON format

  • Creates a Filespec

    Declaration

    Swift

    init?(fromFilespecPath path: String)

    Parameters

    path

    path where a Filespec file located

  • Creates a Filespec

    Declaration

    Swift

    init(url: URL?, path: String?, name: String?, filename: String?, fileExtension: String?, size: Int64?, searchPathDirectoryId: UInt?)

    Parameters

    url

    url from where the file was downloaded

    path

    path where the file is located in the device

    name

    original given name to the file

    filename

    filename that stores in the device

    fileExtension

    File’s extention

    size

    File size, in bytes

    searchPathDirectoryId

    The location of the directory in the Application sandbox