Credential is open to set anytime

This commit is contained in:
Amir Abbas Mousavian
2017-03-26 15:54:55 +04:30
parent 4023fbc62e
commit 99a433a0fc
6 changed files with 11 additions and 7 deletions
+1 -1
View File
@@ -34,7 +34,7 @@ open class DropboxFileProvider: FileProviderBasicRemote {
}
open weak var delegate: FileProviderDelegate?
open let credential: URLCredential?
open var credential: URLCredential?
open private(set) var cache: URLCache?
public var useCache: Bool
public var validatingCache: Bool
+2 -2
View File
@@ -51,13 +51,13 @@ public protocol FileProviderBasic: class, NSCoding, NSSecureCoding {
**Example initialization:**
````
let credential = URLCredential(user: "user", password: "password", persistence: .forSeession)
provider.credential = URLCredential(user: "user", password: "password", persistence: .forSeession)
````
- Note: In OAuth based providers like `DropboxFileProvider` and `OneDriveFileProvider`, password is Token.
use [OAuthSwift](https://github.com/OAuthSwift/OAuthSwift) library to fetch clientId and Token of user.
*/
var credential: URLCredential? { get }
var credential: URLCredential? { get set }
/**
Returns an Array of `FileObject`s identifying the the directory entries via asynchronous completion handler.
+1 -1
View File
@@ -21,7 +21,7 @@ open class LocalFileProvider: FileProvider, FileProviderMonitor, FileProvideUndo
open var dispatch_queue: DispatchQueue
open var operation_queue: OperationQueue
open weak var delegate: FileProviderDelegate?
open internal(set) var credential: URLCredential?
open var credential: URLCredential?
/// Underlying `FileManager` object for listing and metadata fetching.
open private(set) var fileManager = FileManager()
+1 -1
View File
@@ -33,7 +33,7 @@ open class OneDriveFileProvider: FileProviderBasicRemote {
}
open weak var delegate: FileProviderDelegate?
open let credential: URLCredential?
open var credential: URLCredential?
open private(set) var cache: URLCache?
public var useCache: Bool
public var validatingCache: Bool
+1 -1
View File
@@ -15,7 +15,7 @@ class SMBFileProvider: FileProvider, FileProviderMonitor {
open var dispatch_queue: DispatchQueue
open var operation_queue: OperationQueue
open weak var delegate: FileProviderDelegate?
open let credential: URLCredential?
open var credential: URLCredential?
public typealias FileObjectClass = FileObject
+5 -1
View File
@@ -32,7 +32,11 @@ open class WebDAVFileProvider: FileProviderBasicRemote {
}
public weak var delegate: FileProviderDelegate?
open let credential: URLCredential?
open var credential: URLCredential? {
didSet {
sessionDelegate?.credential = credential
}
}
open private(set) var cache: URLCache?
public var useCache: Bool
public var validatingCache: Bool