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** 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
jsonDataData that represent Filespec in JSON format
-
Creates a Filespec
Declaration
Swift
init?(fromFilespecPath path: String)Parameters
pathpath 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
urlurl from where the file was downloaded
pathpath where the file is located in the device
nameoriginal given name to the file
filenamefilename that stores in the device
fileExtensionFile’s extention
sizeFile size, in bytes
searchPathDirectoryIdThe location of the directory in the Application sandbox
Filespec Structure Reference