Marino Faggiana 1 жил өмнө
parent
commit
84f8b0bcca

+ 2 - 2
File Provider Extension/FileProviderExtension.swift

@@ -276,7 +276,7 @@ class FileProviderExtension: NSFileProviderExtension, NCNetworkingDelegate {
             ocId = outstandingOcIdTemp[ocId]!
             ocId = outstandingOcIdTemp[ocId]!
             let atPath = NCUtilityFileSystem.shared.getDirectoryProviderStorageOcId(itemIdentifier.rawValue, fileNameView: fileName)
             let atPath = NCUtilityFileSystem.shared.getDirectoryProviderStorageOcId(itemIdentifier.rawValue, fileNameView: fileName)
             let toPath = NCUtilityFileSystem.shared.getDirectoryProviderStorageOcId(ocId, fileNameView: fileName)
             let toPath = NCUtilityFileSystem.shared.getDirectoryProviderStorageOcId(ocId, fileNameView: fileName)
-            CCUtility.copyFile(atPath: atPath, toPath: toPath)
+            NCUtilityFileSystem.shared.copyFile(atPath: atPath, toPath: toPath)
         }
         }
         guard let metadata = NCManageDatabase.shared.getMetadataFromOcId(ocId) else { return }
         guard let metadata = NCManageDatabase.shared.getMetadataFromOcId(ocId) else { return }
 
 
@@ -418,7 +418,7 @@ class FileProviderExtension: NSFileProviderExtension, NCNetworkingDelegate {
                 // File system
                 // File system
                 let atPath = NCUtilityFileSystem.shared.getDirectoryProviderStorageOcId(ocIdTemp)
                 let atPath = NCUtilityFileSystem.shared.getDirectoryProviderStorageOcId(ocIdTemp)
                 let toPath = NCUtilityFileSystem.shared.getDirectoryProviderStorageOcId(ocId)
                 let toPath = NCUtilityFileSystem.shared.getDirectoryProviderStorageOcId(ocId)
-                CCUtility.copyFile(atPath: atPath, toPath: toPath)
+                NCUtilityFileSystem.shared.copyFile(atPath: atPath, toPath: toPath)
             }
             }
 
 
             fileProviderData.shared.signalEnumerator(ocId: metadata.ocId, update: true)
             fileProviderData.shared.signalEnumerator(ocId: metadata.ocId, update: true)

+ 1 - 1
Share/NCShareExtension.swift

@@ -357,7 +357,7 @@ extension NCShareExtension {
         } completion: { error in
         } completion: { error in
             if error != .success {
             if error != .success {
                 NCManageDatabase.shared.deleteMetadata(predicate: NSPredicate(format: "ocId == %@", metadata.ocId))
                 NCManageDatabase.shared.deleteMetadata(predicate: NSPredicate(format: "ocId == %@", metadata.ocId))
-                NCUtilityFileSystem.shared.deleteFile(filePath: NCUtilityFileSystem.shared.getDirectoryProviderStorageOcId(metadata.ocId))
+                NCUtilityFileSystem.shared.removeFile(atPath: NCUtilityFileSystem.shared.getDirectoryProviderStorageOcId(metadata.ocId))
                 self.uploadErrors.append(metadata)
                 self.uploadErrors.append(metadata)
             }
             }
             self.counterUploaded += 1
             self.counterUploaded += 1

+ 3 - 3
iOSClient/AppDelegate.swift

@@ -102,8 +102,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
 
 
         if NCBrandOptions.shared.disable_log {
         if NCBrandOptions.shared.disable_log {
 
 
-            NCUtilityFileSystem.shared.deleteFile(filePath: NextcloudKit.shared.nkCommonInstance.filenamePathLog)
-            NCUtilityFileSystem.shared.deleteFile(filePath: NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true).first! + "/" + NextcloudKit.shared.nkCommonInstance.filenameLog)
+            NCUtilityFileSystem.shared.removeFile(atPath: NextcloudKit.shared.nkCommonInstance.filenamePathLog)
+            NCUtilityFileSystem.shared.removeFile(atPath: NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true).first! + "/" + NextcloudKit.shared.nkCommonInstance.filenameLog)
 
 
         } else {
         } else {
 
 
@@ -613,7 +613,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
 
 
         let results = NCManageDatabase.shared.getTableLocalFiles(predicate: NSPredicate(format: "account == %@", account), sorted: "ocId", ascending: false)
         let results = NCManageDatabase.shared.getTableLocalFiles(predicate: NSPredicate(format: "account == %@", account), sorted: "ocId", ascending: false)
         for result in results {
         for result in results {
-            CCUtility.removeFile(atPath: NCUtilityFileSystem.shared.getDirectoryProviderStorageOcId(result.ocId))
+            NCUtilityFileSystem.shared.removeFile(atPath: NCUtilityFileSystem.shared.getDirectoryProviderStorageOcId(result.ocId))
         }
         }
         NCManageDatabase.shared.clearDatabase(account: account, removeAccount: true)
         NCManageDatabase.shared.clearDatabase(account: account, removeAccount: true)
 
 

+ 2 - 2
iOSClient/Data/NCManageDatabase+Avatar.swift

@@ -120,7 +120,7 @@ extension NCManageDatabase {
             realm.refresh()
             realm.refresh()
             let result = realm.objects(tableAvatar.self).filter("fileName == %@", fileName).first
             let result = realm.objects(tableAvatar.self).filter("fileName == %@", fileName).first
             if result == nil {
             if result == nil {
-                NCUtilityFileSystem.shared.deleteFile(filePath: fileNameLocalPath)
+                NCUtilityFileSystem.shared.removeFile(atPath: fileNameLocalPath)
                 return nil
                 return nil
             } else if result?.loaded == false {
             } else if result?.loaded == false {
                 return nil
                 return nil
@@ -130,7 +130,7 @@ extension NCManageDatabase {
             NextcloudKit.shared.nkCommonInstance.writeLog("Could not access database: \(error)")
             NextcloudKit.shared.nkCommonInstance.writeLog("Could not access database: \(error)")
         }
         }
 
 
-        NCUtilityFileSystem.shared.deleteFile(filePath: fileNameLocalPath)
+        NCUtilityFileSystem.shared.removeFile(atPath: fileNameLocalPath)
         return nil
         return nil
     }
     }
 }
 }

+ 2 - 2
iOSClient/Data/NCManageDatabase+Chunk.swift

@@ -100,7 +100,7 @@ extension NCManageDatabase {
                 let result = realm.objects(tableChunk.self).filter(NSPredicate(format: "account == %@ AND ocId == %@ AND fileName == %d", account, ocId, Int(fileChunk.fileName) ?? 0))
                 let result = realm.objects(tableChunk.self).filter(NSPredicate(format: "account == %@ AND ocId == %@ AND fileName == %d", account, ocId, Int(fileChunk.fileName) ?? 0))
                 realm.delete(result)
                 realm.delete(result)
                 let filePath = directory + "/\(fileChunk.fileName)"
                 let filePath = directory + "/\(fileChunk.fileName)"
-                NCUtilityFileSystem.shared.deleteFile(filePath: filePath)
+                NCUtilityFileSystem.shared.removeFile(atPath: filePath)
             }
             }
         } catch let error {
         } catch let error {
             NextcloudKit.shared.nkCommonInstance.writeLog("Could not write to database: \(error)")
             NextcloudKit.shared.nkCommonInstance.writeLog("Could not write to database: \(error)")
@@ -115,7 +115,7 @@ extension NCManageDatabase {
                 let results = realm.objects(tableChunk.self).filter(NSPredicate(format: "account == %@ AND ocId == %@", account, ocId))
                 let results = realm.objects(tableChunk.self).filter(NSPredicate(format: "account == %@ AND ocId == %@", account, ocId))
                 for result in results {
                 for result in results {
                     let filePath = directory + "/\(result.fileName)"
                     let filePath = directory + "/\(result.fileName)"
-                    NCUtilityFileSystem.shared.deleteFile(filePath: filePath)
+                    NCUtilityFileSystem.shared.removeFile(atPath: filePath)
                 }
                 }
                 realm.delete(results)
                 realm.delete(results)
             }
             }

+ 1 - 1
iOSClient/Main/Create cloud/NCCreateFormUploadConflict.swift

@@ -258,7 +258,7 @@ class NCCreateFormUploadConflict: UIViewController {
                 // This is not an asset - [file]
                 // This is not an asset - [file]
                 if metadata.assetLocalIdentifier.isEmpty || metadata.isExtractFile {
                 if metadata.assetLocalIdentifier.isEmpty || metadata.isExtractFile {
                     let newPath = NCUtilityFileSystem.shared.getDirectoryProviderStorageOcId(metadata.ocId, fileNameView: newFileName)
                     let newPath = NCUtilityFileSystem.shared.getDirectoryProviderStorageOcId(metadata.ocId, fileNameView: newFileName)
-                    CCUtility.moveFile(atPath: oldPath, toPath: newPath)
+                    NCUtilityFileSystem.shared.moveFile(atPath: oldPath, toPath: newPath)
                 }
                 }
 
 
                 metadatasNOConflict.append(metadata)
                 metadatasNOConflict.append(metadata)

+ 1 - 1
iOSClient/Main/Create cloud/NCCreateFormUploadVoiceNote.swift

@@ -256,7 +256,7 @@ class NCCreateFormUploadVoiceNote: XLFormViewController, NCSelectDelegate, AVAud
 
 
     func dismissAndUpload(_ metadata: tableMetadata) {
     func dismissAndUpload(_ metadata: tableMetadata) {
 
 
-        CCUtility.copyFile(atPath: self.fileNamePath, toPath: NCUtilityFileSystem.shared.getDirectoryProviderStorageOcId(metadata.ocId, fileNameView: metadata.fileNameView))
+        NCUtilityFileSystem.shared.copyFile(atPath: self.fileNamePath, toPath: NCUtilityFileSystem.shared.getDirectoryProviderStorageOcId(metadata.ocId, fileNameView: metadata.fileNameView))
 
 
         NCNetworkingProcessUpload.shared.createProcessUploads(metadatas: [metadata], completion: { _ in })
         NCNetworkingProcessUpload.shared.createProcessUploads(metadatas: [metadata], completion: { _ in })
 
 

+ 1 - 1
iOSClient/Main/NCActionCenter.swift

@@ -85,7 +85,7 @@ class NCActionCenter: NSObject, UIDocumentInteractionControllerDelegate, NCSelec
                 navigationController.modalPresentationStyle = .fullScreen
                 navigationController.modalPresentationStyle = .fullScreen
                 appDelegate.window?.rootViewController?.present(navigationController, animated: true)
                 appDelegate.window?.rootViewController?.present(navigationController, animated: true)
             } else {
             } else {
-                CCUtility.copyFile(atPath: fileNamePath, toPath: fileNameTemp)
+                NCUtilityFileSystem.shared.copyFile(atPath: fileNamePath, toPath: fileNameTemp)
                 appDelegate.window?.rootViewController?.present(viewerQuickLook, animated: true)
                 appDelegate.window?.rootViewController?.present(viewerQuickLook, animated: true)
             }
             }
 
 

+ 1 - 1
iOSClient/Networking/E2EE/NCNetworkingE2EEUpload.swift

@@ -159,7 +159,7 @@ class NCNetworkingE2EEUpload: NSObject {
 
 
         if let afError = resultsSendFile.afError, afError.isExplicitlyCancelledError {
         if let afError = resultsSendFile.afError, afError.isExplicitlyCancelledError {
 
 
-            CCUtility.removeFile(atPath: NCUtilityFileSystem.shared.getDirectoryProviderStorageOcId(metadata.ocId))
+            NCUtilityFileSystem.shared.removeFile(atPath: NCUtilityFileSystem.shared.getDirectoryProviderStorageOcId(metadata.ocId))
             NCManageDatabase.shared.deleteMetadata(predicate: NSPredicate(format: "ocId == %@", metadata.ocId))
             NCManageDatabase.shared.deleteMetadata(predicate: NSPredicate(format: "ocId == %@", metadata.ocId))
             NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterUploadedFile, userInfo: ["ocId": metadata.ocId, "serverUrl": metadata.serverUrl, "account": metadata.account, "fileName": metadata.fileName, "ocIdTemp": ocIdTemp, "error": resultsSendFile.error])
             NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterUploadedFile, userInfo: ["ocId": metadata.ocId, "serverUrl": metadata.serverUrl, "account": metadata.account, "fileName": metadata.fileName, "ocIdTemp": ocIdTemp, "error": resultsSendFile.error])
 
 

+ 10 - 10
iOSClient/Networking/NCNetworking.swift

@@ -659,7 +659,7 @@ class NCNetworking: NSObject, NKCommonDelegate {
                 NCUtilityFileSystem.shared.moveFile(atPath: NCUtilityFileSystem.shared.getDirectoryProviderStorageOcId(ocIdTemp), toPath: NCUtilityFileSystem.shared.getDirectoryProviderStorageOcId(ocId))
                 NCUtilityFileSystem.shared.moveFile(atPath: NCUtilityFileSystem.shared.getDirectoryProviderStorageOcId(ocIdTemp), toPath: NCUtilityFileSystem.shared.getDirectoryProviderStorageOcId(ocId))
                 NCManageDatabase.shared.addLocalFile(metadata: metadata)
                 NCManageDatabase.shared.addLocalFile(metadata: metadata)
             } else {
             } else {
-                NCUtilityFileSystem.shared.deleteFile(filePath: NCUtilityFileSystem.shared.getDirectoryProviderStorageOcId(ocIdTemp))
+                NCUtilityFileSystem.shared.removeFile(atPath: NCUtilityFileSystem.shared.getDirectoryProviderStorageOcId(ocIdTemp))
             }
             }
 
 
             NextcloudKit.shared.nkCommonInstance.writeLog("[SUCCESS] Upload complete " + serverUrl + "/" + fileName + ", result: success(\(size) bytes)")
             NextcloudKit.shared.nkCommonInstance.writeLog("[SUCCESS] Upload complete " + serverUrl + "/" + fileName + ", result: success(\(size) bytes)")
@@ -669,7 +669,7 @@ class NCNetworking: NSObject, NKCommonDelegate {
 
 
             if error.errorCode == NSURLErrorCancelled || error.errorCode == NCGlobal.shared.errorRequestExplicityCancelled {
             if error.errorCode == NSURLErrorCancelled || error.errorCode == NCGlobal.shared.errorRequestExplicityCancelled {
 
 
-                CCUtility.removeFile(atPath: NCUtilityFileSystem.shared.getDirectoryProviderStorageOcId(metadata.ocId))
+                NCUtilityFileSystem.shared.removeFile(atPath: NCUtilityFileSystem.shared.getDirectoryProviderStorageOcId(metadata.ocId))
                 NCManageDatabase.shared.deleteMetadata(predicate: NSPredicate(format: "ocId == %@", metadata.ocId))
                 NCManageDatabase.shared.deleteMetadata(predicate: NSPredicate(format: "ocId == %@", metadata.ocId))
                 NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterUploadCancelFile, userInfo: ["ocId": metadata.ocId, "serverUrl": metadata.serverUrl, "account": metadata.account])
                 NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterUploadCancelFile, userInfo: ["ocId": metadata.ocId, "serverUrl": metadata.serverUrl, "account": metadata.account])
 
 
@@ -685,7 +685,7 @@ class NCNetworking: NSObject, NKCommonDelegate {
                         NCManageDatabase.shared.setMetadataSession(ocId: metadata.ocId, newFileName: newFileName, session: nil, sessionError: "", sessionSelector: nil, sessionTaskIdentifier: 0, status: NCGlobal.shared.metadataStatusWaitUpload, errorCode: error.errorCode)
                         NCManageDatabase.shared.setMetadataSession(ocId: metadata.ocId, newFileName: newFileName, session: nil, sessionError: "", sessionSelector: nil, sessionTaskIdentifier: 0, status: NCGlobal.shared.metadataStatusWaitUpload, errorCode: error.errorCode)
                     }))
                     }))
                     alertController.addAction(UIAlertAction(title: NSLocalizedString("_discard_changes_", comment: ""), style: .destructive, handler: { _ in
                     alertController.addAction(UIAlertAction(title: NSLocalizedString("_discard_changes_", comment: ""), style: .destructive, handler: { _ in
-                        CCUtility.removeFile(atPath: NCUtilityFileSystem.shared.getDirectoryProviderStorageOcId(metadata.ocId))
+                        NCUtilityFileSystem.shared.removeFile(atPath: NCUtilityFileSystem.shared.getDirectoryProviderStorageOcId(metadata.ocId))
                         NCManageDatabase.shared.deleteMetadata(predicate: NSPredicate(format: "ocId == %@", metadata.ocId))
                         NCManageDatabase.shared.deleteMetadata(predicate: NSPredicate(format: "ocId == %@", metadata.ocId))
                         NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterUploadCancelFile, userInfo: ["ocId": metadata.ocId, "serverUrl": metadata.serverUrl, "account": metadata.account])
                         NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterUploadCancelFile, userInfo: ["ocId": metadata.ocId, "serverUrl": metadata.serverUrl, "account": metadata.account])
                     }))
                     }))
@@ -787,12 +787,12 @@ class NCNetworking: NSObject, NKCommonDelegate {
 
 
         // DOWNLOAD
         // DOWNLOAD
         for metadata in metadatasDownload {
         for metadata in metadatasDownload {
-            CCUtility.removeFile(atPath: NCUtilityFileSystem.shared.getDirectoryProviderStorageOcId(metadata.ocId))
+            NCUtilityFileSystem.shared.removeFile(atPath: NCUtilityFileSystem.shared.getDirectoryProviderStorageOcId(metadata.ocId))
             NCManageDatabase.shared.setMetadataSession(ocId: metadata.ocId, session: "", sessionError: "", sessionSelector: "", sessionTaskIdentifier: 0, status: NCGlobal.shared.metadataStatusNormal, errorCode: 0)
             NCManageDatabase.shared.setMetadataSession(ocId: metadata.ocId, session: "", sessionError: "", sessionSelector: "", sessionTaskIdentifier: 0, status: NCGlobal.shared.metadataStatusNormal, errorCode: 0)
         }
         }
         // UPLOAD
         // UPLOAD
         for metadata in metadatasUpload {
         for metadata in metadatasUpload {
-            CCUtility.removeFile(atPath: NCUtilityFileSystem.shared.getDirectoryProviderStorageOcId(metadata.ocId))
+            NCUtilityFileSystem.shared.removeFile(atPath: NCUtilityFileSystem.shared.getDirectoryProviderStorageOcId(metadata.ocId))
             NCManageDatabase.shared.deleteMetadata(predicate: NSPredicate(format: "ocId == %@", metadata.ocId))
             NCManageDatabase.shared.deleteMetadata(predicate: NSPredicate(format: "ocId == %@", metadata.ocId))
         }
         }
 
 
@@ -800,7 +800,7 @@ class NCNetworking: NSObject, NKCommonDelegate {
 
 
         // BACKGROUND
         // BACKGROUND
         for metadata in metadatasUploadBackground {
         for metadata in metadatasUploadBackground {
-            CCUtility.removeFile(atPath: NCUtilityFileSystem.shared.getDirectoryProviderStorageOcId(metadata.ocId))
+            NCUtilityFileSystem.shared.removeFile(atPath: NCUtilityFileSystem.shared.getDirectoryProviderStorageOcId(metadata.ocId))
             NCManageDatabase.shared.deleteMetadata(predicate: NSPredicate(format: "ocId == %@", metadata.ocId))
             NCManageDatabase.shared.deleteMetadata(predicate: NSPredicate(format: "ocId == %@", metadata.ocId))
         }
         }
 
 
@@ -820,7 +820,7 @@ class NCNetworking: NSObject, NKCommonDelegate {
     func cancel(metadata: tableMetadata) async {
     func cancel(metadata: tableMetadata) async {
 
 
         let fileNameLocalPath = NCUtilityFileSystem.shared.getDirectoryProviderStorageOcId(metadata.ocId, fileNameView: metadata.fileNameView)
         let fileNameLocalPath = NCUtilityFileSystem.shared.getDirectoryProviderStorageOcId(metadata.ocId, fileNameView: metadata.fileNameView)
-        CCUtility.removeFile(atPath: NCUtilityFileSystem.shared.getDirectoryProviderStorageOcId(metadata.ocId))
+        NCUtilityFileSystem.shared.removeFile(atPath: NCUtilityFileSystem.shared.getDirectoryProviderStorageOcId(metadata.ocId))
 
 
         // No session found
         // No session found
         if metadata.session.isEmpty {
         if metadata.session.isEmpty {
@@ -1318,11 +1318,11 @@ class NCNetworking: NSObject, NKCommonDelegate {
 
 
                 NCManageDatabase.shared.deleteVideo(metadata: metadata)
                 NCManageDatabase.shared.deleteVideo(metadata: metadata)
                 NCManageDatabase.shared.deleteLocalFile(predicate: NSPredicate(format: "ocId == %@", metadata.ocId))
                 NCManageDatabase.shared.deleteLocalFile(predicate: NSPredicate(format: "ocId == %@", metadata.ocId))
-                NCUtilityFileSystem.shared.deleteFile(filePath: NCUtilityFileSystem.shared.getDirectoryProviderStorageOcId(metadata.ocId))
+                NCUtilityFileSystem.shared.removeFile(atPath: NCUtilityFileSystem.shared.getDirectoryProviderStorageOcId(metadata.ocId))
 
 
                 if let metadataLivePhoto = NCManageDatabase.shared.getMetadataLivePhoto(metadata: metadata) {
                 if let metadataLivePhoto = NCManageDatabase.shared.getMetadataLivePhoto(metadata: metadata) {
                     NCManageDatabase.shared.deleteLocalFile(predicate: NSPredicate(format: "ocId == %@", metadataLivePhoto.ocId))
                     NCManageDatabase.shared.deleteLocalFile(predicate: NSPredicate(format: "ocId == %@", metadataLivePhoto.ocId))
-                    NCUtilityFileSystem.shared.deleteFile(filePath: NCUtilityFileSystem.shared.getDirectoryProviderStorageOcId(metadataLivePhoto.ocId))
+                    NCUtilityFileSystem.shared.removeFile(atPath: NCUtilityFileSystem.shared.getDirectoryProviderStorageOcId(metadataLivePhoto.ocId))
                 }
                 }
             }
             }
             return NKError()
             return NKError()
@@ -1523,7 +1523,7 @@ class NCNetworking: NSObject, NKCommonDelegate {
 
 
                     if ext != extNew {
                     if ext != extNew {
 
 
-                        NCUtilityFileSystem.shared.deleteFile(filePath: NCUtilityFileSystem.shared.getDirectoryProviderStorageOcId(ocId))
+                        NCUtilityFileSystem.shared.removeFile(atPath: NCUtilityFileSystem.shared.getDirectoryProviderStorageOcId(ocId))
                         NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterReloadDataSourceNetworkForced)
                         NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterReloadDataSourceNetworkForced)
 
 
                     } else {
                     } else {

+ 1 - 1
iOSClient/Scan document/NCScan+CollectionView.swift

@@ -56,7 +56,7 @@ extension NCScan: UICollectionViewDataSource {
                 if let indexPath = self.collectionViewSource.indexPathForItem(at: buttonPosition) {
                 if let indexPath = self.collectionViewSource.indexPathForItem(at: buttonPosition) {
 
 
                     let fileNameAtPath = NCUtilityFileSystem.shared.directoryScan + "/" + self.itemsSource[indexPath.row]
                     let fileNameAtPath = NCUtilityFileSystem.shared.directoryScan + "/" + self.itemsSource[indexPath.row]
-                    CCUtility.removeFile(atPath: fileNameAtPath)
+                    NCUtilityFileSystem.shared.removeFile(atPath: fileNameAtPath)
                     self.itemsSource.remove(at: indexPath.row)
                     self.itemsSource.remove(at: indexPath.row)
 
 
                     self.collectionViewSource.deleteItems(at: [indexPath])
                     self.collectionViewSource.deleteItems(at: [indexPath])

+ 0 - 8
iOSClient/Utility/CCUtility.h

@@ -34,8 +34,6 @@
 
 
 @interface CCUtility : NSObject
 @interface CCUtility : NSObject
 
 
-+ (BOOL)addSkipBackupAttributeToItemAtURL:(NSURL *)URL;
-
 + (NSString *)dateDiff:(NSDate *)convertedDate;
 + (NSString *)dateDiff:(NSDate *)convertedDate;
 + (NSString *)transformedSize:(int64_t)value;
 + (NSString *)transformedSize:(int64_t)value;
 
 
@@ -47,12 +45,6 @@
 + (NSString *)createFileName:(NSString *)fileName fileDate:(NSDate *)fileDate fileType:(PHAssetMediaType)fileType keyFileName:(NSString *)keyFileName keyFileNameType:(NSString *)keyFileNameType keyFileNameOriginal:(NSString *)keyFileNameOriginal forcedNewFileName:(BOOL)forcedNewFileName;
 + (NSString *)createFileName:(NSString *)fileName fileDate:(NSDate *)fileDate fileType:(PHAssetMediaType)fileType keyFileName:(NSString *)keyFileName keyFileNameType:(NSString *)keyFileNameType keyFileNameOriginal:(NSString *)keyFileNameOriginal forcedNewFileName:(BOOL)forcedNewFileName;
 
 
 + (NSString *)getTitleSectionDate:(NSDate *)date;
 + (NSString *)getTitleSectionDate:(NSDate *)date;
-
-+ (void)moveFileAtPath:(NSString *)atPath toPath:(NSString *)toPath;
-+ (void)copyFileAtPath:(NSString *)atPath toPath:(NSString *)toPath;
-+ (void)removeFileAtPath:(NSString *)atPath;
-+ (void)createDirectoryAtPath:(NSString *)atPath;
-
 + (NSString *)returnPathfromServerUrl:(NSString *)serverUrl urlBase:(NSString *)urlBase userId:(NSString *)userId account:(NSString *)account;
 + (NSString *)returnPathfromServerUrl:(NSString *)serverUrl urlBase:(NSString *)urlBase userId:(NSString *)userId account:(NSString *)account;
 + (NSString *)returnFileNamePathFromFileName:(NSString *)metadataFileName serverUrl:(NSString *)serverUrl urlBase:(NSString *)urlBase userId:(NSString *)userId account:(NSString *)account;
 + (NSString *)returnFileNamePathFromFileName:(NSString *)metadataFileName serverUrl:(NSString *)serverUrl urlBase:(NSString *)urlBase userId:(NSString *)userId account:(NSString *)account;
 
 

+ 0 - 31
iOSClient/Utility/CCUtility.m

@@ -28,14 +28,6 @@
 #import <CoreLocation/CoreLocation.h>
 #import <CoreLocation/CoreLocation.h>
 #include <sys/stat.h>
 #include <sys/stat.h>
 
 
-
-#define INTRO_MessageType       @"MessageType_"
-
-#define E2E_certificate         @"EndToEndCertificate_"
-#define E2E_PrivateKey          @"EndToEndPrivateKey_"
-#define E2E_Passphrase          @"EndToEndPassphrase_"
-#define E2E_PublicKey           @"EndToEndPublicKeyServer_"
-
 @implementation CCUtility
 @implementation CCUtility
 
 
 #pragma --------------------------------------------------------------------------------------------
 #pragma --------------------------------------------------------------------------------------------
@@ -262,29 +254,6 @@
     return title;
     return title;
 }
 }
 
 
-+ (void)moveFileAtPath:(NSString *)atPath toPath:(NSString *)toPath
-{
-    [[NSFileManager defaultManager] removeItemAtPath:toPath error:nil];
-    [[NSFileManager defaultManager] copyItemAtPath:atPath toPath:toPath error:nil];
-    [[NSFileManager defaultManager] removeItemAtPath:atPath error:nil];
-}
-
-+ (void)copyFileAtPath:(NSString *)atPath toPath:(NSString *)toPath
-{
-    [[NSFileManager defaultManager] removeItemAtPath:toPath error:nil];
-    [[NSFileManager defaultManager] copyItemAtPath:atPath toPath:toPath error:nil];
-}
-
-+ (void)removeFileAtPath:(NSString *)atPath
-{
-    [[NSFileManager defaultManager] removeItemAtPath:atPath error:nil];
-}
-
-+ (void)createDirectoryAtPath:(NSString *)atPath
-{
-    [[NSFileManager defaultManager] createDirectoryAtPath:atPath withIntermediateDirectories:true attributes:nil error:nil];
-}
-
 + (NSString *)returnPathfromServerUrl:(NSString *)serverUrl urlBase:(NSString *)urlBase userId:(NSString *)userId account:(NSString *)account
 + (NSString *)returnPathfromServerUrl:(NSString *)serverUrl urlBase:(NSString *)urlBase userId:(NSString *)userId account:(NSString *)account
 {
 {
     NSString *homeServer = [[NCUtilityFileSystem shared] getHomeServerWithUrlBase:urlBase userId:userId];
     NSString *homeServer = [[NCUtilityFileSystem shared] getHomeServerWithUrlBase:urlBase userId:userId];

+ 3 - 3
iOSClient/Utility/NCCameraRoll.swift

@@ -178,7 +178,7 @@ class NCCameraRoll: NSObject {
                     guard let ciImage = CIImage(data: data), let colorSpace = ciImage.colorSpace, let dataJPEG = CIContext().jpegRepresentation(of: ciImage, colorSpace: colorSpace) else { return callCompletionWithError() }
                     guard let ciImage = CIImage(data: data), let colorSpace = ciImage.colorSpace, let dataJPEG = CIContext().jpegRepresentation(of: ciImage, colorSpace: colorSpace) else { return callCompletionWithError() }
                     data = dataJPEG
                     data = dataJPEG
                 }
                 }
-                NCUtilityFileSystem.shared.deleteFile(filePath: fileNamePath)
+                NCUtilityFileSystem.shared.removeFile(atPath: fileNamePath)
                 do {
                 do {
                     try data.write(to: URL(fileURLWithPath: fileNamePath), options: .atomic)
                     try data.write(to: URL(fileURLWithPath: fileNamePath), options: .atomic)
                 } catch { return callCompletionWithError() }
                 } catch { return callCompletionWithError() }
@@ -200,7 +200,7 @@ class NCCameraRoll: NSObject {
 
 
             PHImageManager.default().requestAVAsset(forVideo: asset, options: options) { asset, _, _ in
             PHImageManager.default().requestAVAsset(forVideo: asset, options: options) { asset, _, _ in
                 if let asset = asset as? AVURLAsset {
                 if let asset = asset as? AVURLAsset {
-                    NCUtilityFileSystem.shared.deleteFile(filePath: fileNamePath)
+                    NCUtilityFileSystem.shared.removeFile(atPath: fileNamePath)
                     do {
                     do {
                         try FileManager.default.copyItem(at: asset.url, to: URL(fileURLWithPath: fileNamePath))
                         try FileManager.default.copyItem(at: asset.url, to: URL(fileURLWithPath: fileNamePath))
                         metadata.creationDate = creationDate as NSDate
                         metadata.creationDate = creationDate as NSDate
@@ -268,7 +268,7 @@ class NCCameraRoll: NSObject {
                 break
                 break
             }
             }
             guard let videoResource = videoResource else { return completion(nil) }
             guard let videoResource = videoResource else { return completion(nil) }
-            NCUtilityFileSystem.shared.deleteFile(filePath: fileNamePath)
+            NCUtilityFileSystem.shared.removeFile(atPath: fileNamePath)
             PHAssetResourceManager.default().writeData(for: videoResource, toFile: URL(fileURLWithPath: fileNamePath), options: nil) { error in
             PHAssetResourceManager.default().writeData(for: videoResource, toFile: URL(fileURLWithPath: fileNamePath), options: nil) { error in
                 if error != nil { return completion(nil) }
                 if error != nil { return completion(nil) }
                 let metadataLivePhoto = NCManageDatabase.shared.createMetadata(account: metadata.account,
                 let metadataLivePhoto = NCManageDatabase.shared.createMetadata(account: metadata.account,

+ 2 - 2
iOSClient/Utility/NCUtilityFileSystem.swift

@@ -264,10 +264,10 @@ class NCUtilityFileSystem: NSObject {
         }
         }
     }
     }
 
 
-    @objc func deleteFile(filePath: String) {
+    @objc func removeFile(atPath: String) {
 
 
         do {
         do {
-            try FileManager.default.removeItem(atPath: filePath)
+            try FileManager.default.removeItem(atPath: atPath)
         } catch {
         } catch {
             print(error)
             print(error)
         }
         }

+ 1 - 1
iOSClient/Viewer/NCViewer.swift

@@ -228,7 +228,7 @@ class NCViewer: NSObject {
         let item = URL(fileURLWithPath: NCUtilityFileSystem.shared.getDirectoryProviderStorageOcId(metadata.ocId, fileNameView: metadata.fileNameView))
         let item = URL(fileURLWithPath: NCUtilityFileSystem.shared.getDirectoryProviderStorageOcId(metadata.ocId, fileNameView: metadata.fileNameView))
         if QLPreviewController.canPreview(item as QLPreviewItem) {
         if QLPreviewController.canPreview(item as QLPreviewItem) {
             let fileNamePath = NSTemporaryDirectory() + metadata.fileNameView
             let fileNamePath = NSTemporaryDirectory() + metadata.fileNameView
-            CCUtility.copyFile(atPath: NCUtilityFileSystem.shared.getDirectoryProviderStorageOcId(metadata.ocId, fileNameView: metadata.fileNameView), toPath: fileNamePath)
+            NCUtilityFileSystem.shared.copyFile(atPath: NCUtilityFileSystem.shared.getDirectoryProviderStorageOcId(metadata.ocId, fileNameView: metadata.fileNameView), toPath: fileNamePath)
             let viewerQuickLook = NCViewerQuickLook(with: URL(fileURLWithPath: fileNamePath), isEditingEnabled: false, metadata: metadata)
             let viewerQuickLook = NCViewerQuickLook(with: URL(fileURLWithPath: fileNamePath), isEditingEnabled: false, metadata: metadata)
             viewController.present(viewerQuickLook, animated: true)
             viewController.present(viewerQuickLook, animated: true)
         } else {
         } else {