FileLink
@objc(FSFileLink)
public class FileLink : NSObject
Represents a FileLink object.
See Filestack Architecture Overview for more information about files.
-
An API key obtained from the Developer Portal.
Declaration
Swift
public let apiKey: String -
A Filestack Handle.
nilby default.Declaration
Swift
@objc public let handle: String -
A Filestack CDN URL corresponding to this
FileLink.Declaration
Swift
@objc public lazy var url: URL { get set }
-
Gets the content associated to this
FileLinkas aDataobject.Declaration
Swift
@objc func getContent(parameters: [String: Any]? = nil, queue: DispatchQueue? = .main, downloadProgress: ((Progress) -> Void)? = nil, completionHandler: @escaping (DataResponse) -> Void)Parameters
parametersAny query string parameters that should be added to the request.
nilby default.queueThe queue on which the downloadProgress and completion handlers are dispatched.
downloadProgressSets a closure to be called periodically during the lifecycle of the Request as data is read from the server.
nilby default.completionHandlerAdds a handler to be called once the request has finished.
-
Gets the image tags associated to this
FileLinkas a JSON payload.Declaration
Swift
@objc func getTags(queue: DispatchQueue? = .main, completionHandler: @escaping (JSONResponse) -> Void)Parameters
queueThe queue on which the completion handler is dispatched.
completionHandlerAdds a handler to be called once the request has finished.
-
Gets the safe for work status associated to this
FileLinkas a JSON payload.Declaration
Swift
@objc func getSafeForWork(queue: DispatchQueue? = .main, completionHandler: @escaping (JSONResponse) -> Void)Parameters
queueThe queue on which the completion handler is dispatched.
completionHandlerAdds a handler to be called once the request has finished.
-
Gets metadata associated to this
Filelinkas a JSON payload.Declaration
Swift
func getMetadata(options: MetadataOptions, queue: DispatchQueue? = .main, completionHandler: @escaping (JSONResponse) -> Void)Parameters
optionsThe options that should be included as part of the response.
queueThe queue on which the completion handler is dispatched.
completionHandlerAdds a handler to be called once the request has finished.
-
Downloads the content associated to this
FileLinkto a destination URL.Declaration
Swift
@objc func download(destinationURL: URL, parameters: [String: Any]? = nil, queue: DispatchQueue? = .main, downloadProgress: ((Progress) -> Void)? = nil, completionHandler: @escaping (DownloadResponse) -> Void)Parameters
destinationURLThe local URL where content should be saved.
parametersAny query string parameters that should be added to the request.
nilby default.queueThe queue on which the downloadProgress and completion handlers are dispatched.
downloadProgressSets a closure to be called periodically during the lifecycle of the Request as data is read from the server.
nilby default.completionHandlerAdds a handler to be called once the request has finished.
-
Removes this
FileLinkfrom Filestack.Declaration
Swift
@objc func delete(parameters: [String: Any]? = nil, queue: DispatchQueue? = .main, completionHandler: @escaping (DataResponse) -> Void)Parameters
parametersAny query string parameters that should be added to the request.
nilby default.queueThe queue on which the completion handler is dispatched.
completionHandlerAdds a handler to be called once the request has finished.
-
Overwrites this
FileLinkwith a provided local file.Declaration
Swift
@objc func overwrite(parameters: [String: Any]? = nil, fileURL: URL, queue: DispatchQueue? = .main, uploadProgress: ((Progress) -> Void)? = nil, completionHandler: @escaping (DataResponse) -> Void)Parameters
parametersAny query string parameters that should be added to the request.
nilby default.fileURLA local file that will replace the existing remote content.
queueThe queue on which the uploadProgress and completion handlers are dispatched.
uploadProgressSets a closure to be called periodically during the lifecycle of the Request as data is written on the server.
nilby default.completionHandlerAdds a handler to be called once the request has finished.
-
Overwrites this
FileLinkwith a provided remote URL.Declaration
Swift
@objc func overwrite(parameters: [String: Any]? = nil, remoteURL: URL, queue: DispatchQueue? = .main, completionHandler: @escaping (DataResponse) -> Void)Parameters
parametersAny query string parameters that should be added to the request.
nilby default.queueThe queue on which the completion handler is dispatched.
remoteURLA remote
URLwhose content will replace the existing remote content.completionHandlerAdds a handler to be called once the request has finished.
-
Returns an
Transformablecorresponding to thisFileLink.Declaration
Swift
@objc func transformable() -> Transformable
View on GitHub
FileLink Class Reference