Skip to content

Commit 2cba6ba

Browse files
async parameter
Signed-off-by: Marino Faggiana <marino.faggiana@nextcloud.com>
1 parent 2fa2ba6 commit 2cba6ba

2 files changed

Lines changed: 5 additions & 11 deletions

File tree

Sources/NextcloudKit/NextcloudKit+Upload.swift

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -111,17 +111,7 @@ public extension NextcloudKit {
111111

112112
/// Asynchronously uploads a file to the Nextcloud server.
113113
///
114-
/// - Parameters:
115-
/// - serverUrlFileName: The remote server URL or path where the file will be uploaded.
116-
/// - fileNameLocalPath: The local file path to be uploaded.
117-
/// - dateCreationFile: Optional creation date to include in headers (X-OC-CTime).
118-
/// - dateModificationFile: Optional modification date to include in headers (X-OC-MTime).
119-
/// - overwrite: If true, the remote file will be overwritten if it already exists.
120-
/// - account: The account associated with the upload session.
121-
/// - options: Optional configuration for the request (headers, queue, timeout, etc.).
122-
/// - requestHandler: Called with the created UploadRequest.
123-
/// - taskHandler: Called with the underlying URLSessionTask when it's created.
124-
/// - progressHandler: Called periodically with upload progress.
114+
/// - Parameters: Same as the synchronous version.
125115
///
126116
/// - Returns: A tuple containing:
127117
/// - account: The account used for the upload.
@@ -136,6 +126,7 @@ public extension NextcloudKit {
136126
dateCreationFile: Date? = nil,
137127
dateModificationFile: Date? = nil,
138128
overwrite: Bool = false,
129+
autoMkcol: Bool = false,
139130
account: String,
140131
options: NKRequestOptions = NKRequestOptions(),
141132
requestHandler: @escaping (_ request: UploadRequest) -> Void = { _ in },
@@ -156,6 +147,7 @@ public extension NextcloudKit {
156147
dateCreationFile: dateCreationFile,
157148
dateModificationFile: dateModificationFile,
158149
overwrite: overwrite,
150+
autoMkcol: autoMkcol,
159151
account: account,
160152
options: options,
161153
requestHandler: requestHandler,

Sources/NextcloudKit/NextcloudKitBackground.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ public final class NKBackground: NSObject, URLSessionTaskDelegate, URLSessionDel
230230
dateModificationFile: Date?,
231231
taskDescription: String? = nil,
232232
overwrite: Bool = false,
233+
autoMkcol: Bool = false,
233234
account: String,
234235
automaticResume: Bool = true,
235236
sessionIdentifier: String) async -> (
@@ -243,6 +244,7 @@ public final class NKBackground: NSObject, URLSessionTaskDelegate, URLSessionDel
243244
dateModificationFile: dateModificationFile,
244245
taskDescription: taskDescription,
245246
overwrite: overwrite,
247+
autoMkcol: autoMkcol,
246248
account: account,
247249
automaticResume: automaticResume,
248250
sessionIdentifier: sessionIdentifier)

0 commit comments

Comments
 (0)