static let localFileOps = Logger(subsystem: subsystem, category: "localfileoperations")
static let ncFilesDatabase = Logger(subsystem: subsystem, category: "nextcloudfilesdatabase")
static let shares = Logger(subsystem: subsystem, category: "shares")
+ static let ncAccount = Logger(subsystem: subsystem, category: "ncAccount")
static let materialisedFileHandling = Logger(
subsystem: subsystem, category: "materialisedfilehandling"
)
import FileProvider
import Foundation
+import OSLog
let ncAccountDictUsernameKey = "usernameKey"
let ncAccountDictPasswordKey = "passwordKey"
davFilesUrl = serverUrl + NextcloudAccount.webDavFilesUrlSuffix + user
}
+ init?(dictionary: Dictionary<String, String>) {
+ guard let username = dictionary[ncAccountDictUsernameKey],
+ let password = dictionary[ncAccountDictPasswordKey],
+ let ncKitAccount = dictionary[ncAccountDictNcKitAccountKey],
+ let serverUrl = dictionary[ncAccountDictServerUrlKey],
+ let davFilesUrl = dictionary[ncAccountDictDavFilesUrlKey]
+ else {
+ Logger.ncAccount.error("Could not convert dictionary to NextcloudAccount!")
+ return nil
+ }
+
+ self.username = username
+ self.password = password
+ self.ncKitAccount = ncKitAccount
+ self.serverUrl = serverUrl
+ self.davFilesUrl = davFilesUrl
+ }
+
func dictionary() -> Dictionary<String, String> {
return [
ncAccountDictUsernameKey: username,