From fd36df67f334ca36cf82499042cd024cf6e737ea Mon Sep 17 00:00:00 2001 From: Amir Abbas Date: Sat, 1 Jul 2017 09:43:45 +0430 Subject: [PATCH] FTP passive property encoding - removed redundant protocol conforming --- Sources/FTPFileProvider.swift | 4 ++-- Sources/FileProvider.swift | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Sources/FTPFileProvider.swift b/Sources/FTPFileProvider.swift index a42e670..33f6e74 100644 --- a/Sources/FTPFileProvider.swift +++ b/Sources/FTPFileProvider.swift @@ -100,7 +100,7 @@ open class FTPFileProvider: FileProviderBasicRemote { public required convenience init?(coder aDecoder: NSCoder) { guard let baseURL = aDecoder.decodeObject(forKey: "baseURL") as? URL else { return nil } - self.init(baseURL: baseURL, credential: aDecoder.decodeObject(forKey: "credential") as? URLCredential) + self.init(baseURL: baseURL, passive: aDecoder.decodeBool(forKey: "passiveMode"), credential: aDecoder.decodeObject(forKey: "credential") as? URLCredential) self.currentPath = aDecoder.decodeObject(forKey: "currentPath") as? String ?? "" self.useCache = aDecoder.decodeBool(forKey: "useCache") self.validatingCache = aDecoder.decodeBool(forKey: "validatingCache") @@ -114,6 +114,7 @@ open class FTPFileProvider: FileProviderBasicRemote { aCoder.encode(self.useCache, forKey: "useCache") aCoder.encode(self.validatingCache, forKey: "validatingCache") aCoder.encode(self.useAppleImplementation, forKey: "useAppleImplementation") + aCoder.encode(self.passiveMode, forKey: "passiveMode") } public static var supportsSecureCoding: Bool { @@ -160,7 +161,6 @@ open class FTPFileProvider: FileProviderBasicRemote { `contents`: An array of `FileObject` identifying the the directory entries. `error`: Error returned by system. */ - open func contentsOfDirectory(path apath: String, rfc3659enabled: Bool , completionHandler: @escaping ((_ contents: [FileObject], _ error: Error?) -> Void)) { let path = ftpPath(apath) diff --git a/Sources/FileProvider.swift b/Sources/FileProvider.swift index 3d54c25..14371cc 100644 --- a/Sources/FileProvider.swift +++ b/Sources/FileProvider.swift @@ -19,7 +19,7 @@ public typealias ImageClass = NSImage public typealias SimpleCompletionHandler = ((_ error: Error?) -> Void)? /// This protocol defines FileProvider neccesary functions and properties to connect and get contents list -public protocol FileProviderBasic: class, NSCoding, NSSecureCoding { +public protocol FileProviderBasic: class, NSSecureCoding { /// An string to identify type of provider. static var type: String { get } @@ -631,7 +631,7 @@ public protocol FileProviderSharing { } /// Defines protocol for provider allows all common operations. -public protocol FileProvider: FileProviderBasic, FileProviderOperations, FileProviderReadWrite, NSCopying { +public protocol FileProvider: FileProviderOperations, FileProviderReadWrite, NSCopying { } internal let pathTrimSet = CharacterSet(charactersIn: " /")