Class
FileLink
@objc(FSFileLink)
public class FileLink: NSObject
Represents a FileLink
object.
See Filestack Architecture Overview for more information about files.
Relationships
Conforms To
NSObject
Properties
Methods
getContent(parameters:queue:downloadProgress:completionHandler:)
@objc func getContent(parameters: [String: Any]? = nil,
queue: DispatchQueue? = .main,
downloadProgress: ((Progress) -> Void)? = nil,
completionHandler: @escaping (DataResponse) -> Void)
Gets the content associated to this FileLink
as a Data
object.
Parameters
Name | Type | Description |
---|---|---|
parameters | [String: Any]? |
Any query string parameters that should be added to the request. |
queue | DispatchQueue? |
The queue on which the downloadProgress and completion handlers are dispatched. |
downloadProgress | ((Progress) -> Void)? |
Sets a closure to be called periodically during the lifecycle of the Request as data is read from the server. |
completionHandler | @escaping (DataResponse) -> Void |
Adds a handler to be called once the request has finished. |
getTags(queue:completionHandler:)
@objc func getTags(queue: DispatchQueue? = .main,
completionHandler: @escaping (JSONResponse) -> Void)
Gets the image tags associated to this FileLink
as a JSON payload.
Parameters
Name | Type | Description |
---|---|---|
queue | DispatchQueue? |
The queue on which the completion handler is dispatched. |
completionHandler | @escaping (JSONResponse) -> Void |
Adds a handler to be called once the request has finished. |
getSafeForWork(queue:completionHandler:)
@objc func getSafeForWork(queue: DispatchQueue? = .main,
completionHandler: @escaping (JSONResponse) -> Void)
Gets the safe for work status associated to this FileLink
as a JSON payload.
Parameters
Name | Type | Description |
---|---|---|
queue | DispatchQueue? |
The queue on which the completion handler is dispatched. |
completionHandler | @escaping (JSONResponse) -> Void |
Adds a handler to be called once the request has finished. |
getMetadata(options:queue:completionHandler:)
func getMetadata(options: MetadataOptions,
queue: DispatchQueue? = .main,
completionHandler: @escaping (JSONResponse) -> Void)
Gets metadata associated to this Filelink
as a JSON payload.
Parameters
Name | Type | Description |
---|---|---|
options | MetadataOptions |
The options that should be included as part of the response. |
queue | DispatchQueue? |
The queue on which the completion handler is dispatched. |
completionHandler | @escaping (JSONResponse) -> Void |
Adds a handler to be called once the request has finished. |
download(destinationURL:parameters:queue:downloadProgress:completionHandler:)
@objc func download(destinationURL: URL,
parameters: [String: Any]? = nil,
queue: DispatchQueue? = .main,
downloadProgress: ((Progress) -> Void)? = nil,
completionHandler: @escaping (DownloadResponse) -> Void)
Downloads the content associated to this FileLink
to a destination URL.
Parameters
Name | Type | Description |
---|---|---|
destinationURL | URL |
The local URL where content should be saved. |
parameters | [String: Any]? |
Any query string parameters that should be added to the request. |
queue | DispatchQueue? |
The queue on which the downloadProgress and completion handlers are dispatched. |
downloadProgress | ((Progress) -> Void)? |
Sets a closure to be called periodically during the lifecycle of the Request as data is read from the server. |
completionHandler | @escaping (DownloadResponse) -> Void |
Adds a handler to be called once the request has finished. |
delete(parameters:queue:completionHandler:)
@objc func delete(parameters: [String: Any]? = nil,
queue: DispatchQueue? = .main,
completionHandler: @escaping (DataResponse) -> Void)
Removes this FileLink
from Filestack.
Parameters
Name | Type | Description |
---|---|---|
parameters | [String: Any]? |
Any query string parameters that should be added to the request. |
queue | DispatchQueue? |
The queue on which the completion handler is dispatched. |
completionHandler | @escaping (DataResponse) -> Void |
Adds a handler to be called once the request has finished. |
overwrite(parameters:fileURL:queue:uploadProgress:completionHandler:)
@objc func overwrite(parameters: [String: Any]? = nil,
fileURL: URL,
queue: DispatchQueue? = .main,
uploadProgress: ((Progress) -> Void)? = nil,
completionHandler: @escaping (DataResponse) -> Void)
Overwrites this FileLink
with a provided local file.
Parameters
Name | Type | Description |
---|---|---|
parameters | [String: Any]? |
Any query string parameters that should be added to the request. |
fileURL | URL |
A local file that will replace the existing remote content. |
queue | DispatchQueue? |
The queue on which the uploadProgress and completion handlers are dispatched. |
uploadProgress | ((Progress) -> Void)? |
Sets a closure to be called periodically during the lifecycle of the Request as data is written on the server. |
completionHandler | @escaping (DataResponse) -> Void |
Adds a handler to be called once the request has finished. |
overwrite(parameters:remoteURL:queue:completionHandler:)
@objc func overwrite(parameters: [String: Any]? = nil,
remoteURL: URL,
queue: DispatchQueue? = .main,
completionHandler: @escaping (DataResponse) -> Void)
Overwrites this FileLink
with a provided remote URL.
Parameters
Name | Type | Description |
---|---|---|
parameters | [String: Any]? |
Any query string parameters that should be added to the request. |
queue | DispatchQueue? |
The queue on which the completion handler is dispatched. |
remoteURL | URL |
A remote |
completionHandler | @escaping (DataResponse) -> Void |
Adds a handler to be called once the request has finished. |
transformable()
@objc func transformable() -> Transformable
Returns an Transformable
corresponding to this FileLink
.