Fix URL path composition for utility methods in NextcloudFileProviderFilesUtils
authorClaudio Cambra <claudio.cambra@nextcloud.com>
Mon, 30 Jan 2023 19:29:58 +0000 (20:29 +0100)
committerClaudio Cambra <claudio.cambra@nextcloud.com>
Fri, 12 May 2023 05:21:16 +0000 (13:21 +0800)
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
shell_integration/MacOSX/NextcloudIntegration/FileProviderExt/NextcloudFileProviderFilesUtils.swift

index 110ee49da293625600c09707b851a4069d54a5f8..eaa4ce0dec6ca5a88991870a9fad16688b0cb1b4 100644 (file)
@@ -26,12 +26,12 @@ func pathForAppGroupContainer() -> URL? {
 
 func pathForFileProviderExtData() -> URL? {
     let containerUrl = pathForAppGroupContainer()
-    return containerUrl?.appendingPathExtension("FileProviderExt/")
+    return containerUrl?.appendingPathComponent("FileProviderExt/")
 }
 
 func pathForFileProviderExtFiles() -> URL? {
     let fileProviderDataUrl = pathForFileProviderExtData()
-    return fileProviderDataUrl?.appendingPathExtension("Files/")
+    return fileProviderDataUrl?.appendingPathComponent("Files/")
 }
 
 @discardableResult func localPathForNCDirectory(ocId: String) throws -> URL {
@@ -39,7 +39,7 @@ func pathForFileProviderExtFiles() -> URL? {
         throw URLError(.badURL)
     }
 
-    let folderPathUrl = fileProviderFilesPathUrl.appendingPathExtension(ocId)
+    let folderPathUrl = fileProviderFilesPathUrl.appendingPathComponent(ocId)
     let folderPath = folderPathUrl.path
 
     if !FileManager.default.fileExists(atPath: folderPath) {
@@ -61,7 +61,7 @@ func pathForFileProviderExtFiles() -> URL? {
 
 @discardableResult func localPathForNCFile(ocId: String, fileNameView: String) throws -> URL {
     let fileFolderPathUrl = try localPathForNCDirectory(ocId: ocId)
-    let filePathUrl = fileFolderPathUrl.appendingPathExtension(fileNameView)
+    let filePathUrl = fileFolderPathUrl.appendingPathComponent(fileNameView)
     let filePath = filePathUrl.path
 
     if !FileManager.default.fileExists(atPath: filePath) {