|
@@ -171,7 +171,7 @@ import NCCommunication
|
|
|
|
|
|
@objc func readFolder(serverUrl: String, account: String, completion: @escaping (_ account: String, _ metadataFolder: tableMetadata?, _ metadatas: [tableMetadata]?, _ errorCode: Int, _ errorDescription: String)->()) {
|
|
|
|
|
|
- NCCommunication.shared.readFileOrFolder(serverUrlFileName: serverUrl, depth: "1", showHiddenFiles: CCUtility.getShowHiddenFiles(), customUserAgent: nil, addCustomHeaders: nil, account: account) { (account, files, errorCode, errorDescription) in
|
|
|
+ NCCommunication.shared.readFileOrFolder(serverUrlFileName: serverUrl, depth: "1", showHiddenFiles: CCUtility.getShowHiddenFiles()) { (account, files, errorCode, errorDescription) in
|
|
|
|
|
|
if errorCode == 0 && files != nil {
|
|
|
|
|
@@ -225,7 +225,7 @@ import NCCommunication
|
|
|
|
|
|
@objc func readFile(serverUrlFileName: String, account: String, completion: @escaping (_ account: String, _ metadata: tableMetadata?, _ errorCode: Int, _ errorDescription: String)->()) {
|
|
|
|
|
|
- NCCommunication.shared.readFileOrFolder(serverUrlFileName: serverUrlFileName, depth: "0", showHiddenFiles: CCUtility.getShowHiddenFiles(), customUserAgent: nil, addCustomHeaders: nil, account: account) { (account, files, errorCode, errorDescription) in
|
|
|
+ NCCommunication.shared.readFileOrFolder(serverUrlFileName: serverUrlFileName, depth: "0", showHiddenFiles: CCUtility.getShowHiddenFiles()) { (account, files, errorCode, errorDescription) in
|
|
|
|
|
|
if errorCode == 0 && files != nil {
|
|
|
if files?.count ?? 0 == 1 {
|
|
@@ -269,7 +269,7 @@ import NCCommunication
|
|
|
}
|
|
|
let fileNameFolderUrl = serverUrl + "/" + fileNameFolder
|
|
|
|
|
|
- NCCommunication.shared.createFolder(fileNameFolderUrl, customUserAgent: nil, addCustomHeaders: nil, account: account) { (account, ocId, date, errorCode, errorDescription) in
|
|
|
+ NCCommunication.shared.createFolder(fileNameFolderUrl) { (account, ocId, date, errorCode, errorDescription) in
|
|
|
if errorCode == 0 {
|
|
|
self.readFile(serverUrlFileName: fileNameFolderUrl, account: account) { (account, metadataFolder, errorCode, errorDescription) in
|
|
|
if errorCode == 0 {
|
|
@@ -339,7 +339,7 @@ import NCCommunication
|
|
|
}
|
|
|
|
|
|
let serverUrlFileName = metadata.serverUrl + "/" + metadata.fileName
|
|
|
- NCCommunication.shared.deleteFileOrFolder(serverUrlFileName, customUserAgent: nil, addCustomHeaders: addCustomHeaders, account: metadata.account) { (account, errorCode, errorDescription) in
|
|
|
+ NCCommunication.shared.deleteFileOrFolder(serverUrlFileName) { (account, errorCode, errorDescription) in
|
|
|
|
|
|
if errorCode == 0 || errorCode == kOCErrorServerPathNotFound {
|
|
|
|
|
@@ -382,7 +382,7 @@ import NCCommunication
|
|
|
let fileName = CCUtility.returnFileNamePath(fromFileName: metadata.fileName, serverUrl: metadata.serverUrl, activeUrl: url)!
|
|
|
let favorite = !metadata.favorite
|
|
|
|
|
|
- NCCommunication.shared.setFavorite(fileName: fileName, favorite: favorite, customUserAgent: nil, addCustomHeaders: nil, account: metadata.account) { (account, errorCode, errorDescription) in
|
|
|
+ NCCommunication.shared.setFavorite(fileName: fileName, favorite: favorite) { (account, errorCode, errorDescription) in
|
|
|
|
|
|
if errorCode == 0 && metadata.account == account {
|
|
|
NCManageDatabase.sharedInstance.setMetadataFavorite(ocId: metadata.ocId, favorite: favorite)
|
|
@@ -450,7 +450,7 @@ import NCCommunication
|
|
|
let fileNamePath = metadata.serverUrl + "/" + metadata.fileName
|
|
|
let fileNameToPath = metadata.serverUrl + "/" + fileNameNew
|
|
|
|
|
|
- NCCommunication.shared.moveFileOrFolder(serverUrlFileNameSource: fileNamePath, serverUrlFileNameDestination: fileNameToPath, overwrite: false, customUserAgent: nil, addCustomHeaders: nil, account: metadata.account) { (account, errorCode, errorDescription) in
|
|
|
+ NCCommunication.shared.moveFileOrFolder(serverUrlFileNameSource: fileNamePath, serverUrlFileNameDestination: fileNameToPath, overwrite: false) { (account, errorCode, errorDescription) in
|
|
|
|
|
|
if errorCode == 0 {
|
|
|
|
|
@@ -515,7 +515,7 @@ import NCCommunication
|
|
|
let serverUrlFileNameSource = metadata.serverUrl + "/" + metadata.fileName
|
|
|
let serverUrlFileNameDestination = serverUrlTo + "/" + metadata.fileName
|
|
|
|
|
|
- NCCommunication.shared.moveFileOrFolder(serverUrlFileNameSource: serverUrlFileNameSource, serverUrlFileNameDestination: serverUrlFileNameDestination, overwrite: overwrite, customUserAgent: nil, addCustomHeaders: nil, account: metadata.account) { (account, errorCode, errorDescription) in
|
|
|
+ NCCommunication.shared.moveFileOrFolder(serverUrlFileNameSource: serverUrlFileNameSource, serverUrlFileNameDestination: serverUrlFileNameDestination, overwrite: overwrite) { (account, errorCode, errorDescription) in
|
|
|
|
|
|
var metadataNew = tableMetadata()
|
|
|
|
|
@@ -566,7 +566,7 @@ import NCCommunication
|
|
|
let serverUrlFileNameSource = metadata.serverUrl + "/" + metadata.fileName
|
|
|
let serverUrlFileNameDestination = serverUrlTo + "/" + metadata.fileName
|
|
|
|
|
|
- NCCommunication.shared.copyFileOrFolder(serverUrlFileNameSource: serverUrlFileNameSource, serverUrlFileNameDestination: serverUrlFileNameDestination, overwrite: overwrite, customUserAgent: nil, addCustomHeaders: nil, account: metadata.account) { (account, errorCode, errorDescription) in
|
|
|
+ NCCommunication.shared.copyFileOrFolder(serverUrlFileNameSource: serverUrlFileNameSource, serverUrlFileNameDestination: serverUrlFileNameDestination, overwrite: overwrite) { (account, errorCode, errorDescription) in
|
|
|
|
|
|
self.NotificationPost(name: k_notificationCenter_copyFile, userInfo: ["metadata": metadata, "errorCode": errorCode], errorDescription: errorDescription, completion: completion)
|
|
|
}
|