Fixed currentPath docs, delegateNotify method default error arg
This commit is contained in:
@@ -16,7 +16,7 @@ Pod::Spec.new do |s|
|
||||
#
|
||||
|
||||
s.name = "FilesProvider"
|
||||
s.version = "0.20.0"
|
||||
s.version = "0.20.1"
|
||||
s.summary = "FileManager replacement for Local and Remote (WebDAV/FTP/Dropbox/OneDrive/SMB2) files on iOS and macOS."
|
||||
|
||||
# This description is used to generate tags and improve search results.
|
||||
|
||||
@@ -645,7 +645,7 @@
|
||||
799396601D48B7BF00086753 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
BUNDLE_VERSION_STRING = 0.20.0;
|
||||
BUNDLE_VERSION_STRING = 0.20.1;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
@@ -677,7 +677,7 @@
|
||||
799396611D48B7BF00086753 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
BUNDLE_VERSION_STRING = 0.20.0;
|
||||
BUNDLE_VERSION_STRING = 0.20.1;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
|
||||
@@ -118,7 +118,7 @@ open class CloudFileProvider: LocalFileProvider, FileProviderSharing {
|
||||
|
||||
If the directory contains no entries or an error is occured, this method will return the empty array.
|
||||
|
||||
- Parameter path: path to target directory. If empty, `currentPath` value will be used.
|
||||
- Parameter path: path to target directory. If empty, root will be iterated.
|
||||
- Parameter completionHandler: a closure with result of directory entries or error.
|
||||
`contents`: An array of `FileObject` identifying the the directory entries.
|
||||
`error`: Error returned by system.
|
||||
@@ -187,7 +187,7 @@ open class CloudFileProvider: LocalFileProvider, FileProviderSharing {
|
||||
|
||||
If the directory contains no entries or an error is occured, this method will return the empty `FileObject`.
|
||||
|
||||
- Parameter path: path to target directory. If empty, `currentPath` value will be used.
|
||||
- Parameter path: path to target directory. If empty, attributes of root will be returned.
|
||||
- Parameter completionHandler: a closure with result of directory entries or error.
|
||||
`attributes`: A `FileObject` containing the attributes of the item.
|
||||
`error`: Error returned by system.
|
||||
@@ -432,7 +432,7 @@ open class CloudFileProvider: LocalFileProvider, FileProviderSharing {
|
||||
let toUrl = self.url(of: toPath)
|
||||
try self.opFileManager.setUbiquitous(true, itemAt: tmpFile, destinationURL: toUrl)
|
||||
completionHandler?(nil)
|
||||
self.delegateNotify(operation, error: nil)
|
||||
self.delegateNotify(operation)
|
||||
} catch let e {
|
||||
if self.opFileManager.fileExists(atPath: tmpFile.path) {
|
||||
try? self.opFileManager.removeItem(at: tmpFile)
|
||||
@@ -663,7 +663,7 @@ open class CloudFileProvider: LocalFileProvider, FileProviderSharing {
|
||||
progress?.completedUnitCount = progress?.totalUnitCount ?? 0
|
||||
query.stop()
|
||||
NotificationCenter.default.removeObserver(updateObserver!)
|
||||
self.delegateNotify(operation, error: nil)
|
||||
self.delegateNotify(operation)
|
||||
}
|
||||
|
||||
query.enableUpdates()
|
||||
|
||||
@@ -505,7 +505,6 @@ public class FileProviderStreamTask: URLSessionTask, StreamDelegate {
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
operation_queue.addOperation {
|
||||
self.dataToBeSent.append(data)
|
||||
let result = self.write(timeout: timeout, close: false)
|
||||
|
||||
@@ -161,7 +161,7 @@ open class FTPFileProvider: FileProviderBasicRemote, FileProviderOperations, Fil
|
||||
|
||||
If the directory contains no entries or an error is occured, this method will return the empty array.
|
||||
|
||||
- Parameter path: path to target directory. If empty, `currentPath` value will be used.
|
||||
- Parameter path: path to target directory. If empty, root will be iterated.
|
||||
- Parameter rfc3659enabled: uses MLST command instead of old LIST to get files attributes, default is `true`.
|
||||
- Parameter completionHandler: a closure with result of directory entries or error.
|
||||
`contents`: An array of `FileObject` identifying the the directory entries.
|
||||
@@ -216,7 +216,7 @@ open class FTPFileProvider: FileProviderBasicRemote, FileProviderOperations, Fil
|
||||
|
||||
If the directory contains no entries or an error is occured, this method will return the empty `FileObject`.
|
||||
|
||||
- Parameter path: path to target directory. If empty, `currentPath` value will be used.
|
||||
- Parameter path: path to target directory. If empty, attributes of root will be returned.
|
||||
- Parameter rfc3659enabled: uses MLST command instead of old LIST to get files attributes, default is true.
|
||||
- Parameter completionHandler: a closure with result of directory entries or error.
|
||||
`attributes`: A `FileObject` containing the attributes of the item.
|
||||
@@ -502,7 +502,7 @@ open class FTPFileProvider: FileProviderBasicRemote, FileProviderOperations, Fil
|
||||
try? FileManager.default.moveItem(at: tmpurl, to: destURL)
|
||||
self.dispatch_queue.async {
|
||||
completionHandler?(nil)
|
||||
self.delegateNotify(operation, error: nil)
|
||||
self.delegateNotify(operation)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -557,7 +557,7 @@ open class FTPFileProvider: FileProviderBasicRemote, FileProviderOperations, Fil
|
||||
if length == 0 || offset < 0 {
|
||||
dispatch_queue.async {
|
||||
completionHandler(Data(), nil)
|
||||
self.delegateNotify(operation, error: nil)
|
||||
self.delegateNotify(operation)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
@@ -598,7 +598,7 @@ open class FTPFileProvider: FileProviderBasicRemote, FileProviderOperations, Fil
|
||||
if let data = data {
|
||||
self.dispatch_queue.async {
|
||||
completionHandler(data, nil)
|
||||
self.delegateNotify(operation, error: nil)
|
||||
self.delegateNotify(operation)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -777,7 +777,7 @@ extension FTPFileProvider {
|
||||
self.dispatch_queue.async {
|
||||
completionHandler?(nil)
|
||||
}
|
||||
self.delegateNotify(operation, error: nil)
|
||||
self.delegateNotify(operation)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -807,7 +807,7 @@ extension FTPFileProvider {
|
||||
progress.becomeCurrent(withPendingUnitCount: 1)
|
||||
_ = self.copyItem(localFile: localURL, to: destPath) { error in
|
||||
completionHandler?(nil)
|
||||
self.delegateNotify(operation, error: nil)
|
||||
self.delegateNotify(operation)
|
||||
}
|
||||
progress.resignCurrent()
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ public protocol FileProviderBasic: class, NSSecureCoding {
|
||||
|
||||
If the directory contains no entries or an error is occured, this method will return the empty array.
|
||||
|
||||
- Parameter path: path to target directory. If empty, `currentPath` value will be used.
|
||||
- Parameter path: path to target directory. If empty, root will be iterated.
|
||||
- Parameter completionHandler: a closure with result of directory entries or error.
|
||||
- `contents`: An array of `FileObject` identifying the the directory entries.
|
||||
- `error`: Error returned by system.
|
||||
@@ -77,7 +77,7 @@ public protocol FileProviderBasic: class, NSSecureCoding {
|
||||
|
||||
If the directory contains no entries or an error is occured, this method will return the empty `FileObject`.
|
||||
|
||||
- Parameter path: path to target directory. If empty, `currentPath` value will be used.
|
||||
- Parameter path: path to target directory. If empty, attributes of root will be returned.
|
||||
- Parameter completionHandler: a closure with result of directory entries or error.
|
||||
- `attributes`: A `FileObject` containing the attributes of the item.
|
||||
- `error`: Error returned by system.
|
||||
@@ -420,7 +420,7 @@ public extension FileProviderOperations {
|
||||
}
|
||||
|
||||
internal extension FileProviderOperations {
|
||||
internal func delegateNotify(_ operation: FileOperationType, error: Error?) {
|
||||
internal func delegateNotify(_ operation: FileOperationType, error: Error? = nil) {
|
||||
DispatchQueue.main.async(execute: {
|
||||
if let error = error {
|
||||
self.delegate?.fileproviderFailed(self, operation: operation, error: error)
|
||||
|
||||
@@ -209,7 +209,7 @@ open class HTTPFileProvider: FileProviderBasicRemote, FileProviderOperations, Fi
|
||||
do {
|
||||
try FileManager.default.moveItem(at: tempURL, to: destURL)
|
||||
completionHandler?(nil)
|
||||
self?.delegateNotify(operation, error: nil)
|
||||
self?.delegateNotify(operation)
|
||||
} catch let e {
|
||||
completionHandler?(e)
|
||||
self?.delegateNotify(operation, error: e)
|
||||
@@ -371,7 +371,7 @@ open class HTTPFileProvider: FileProviderBasicRemote, FileProviderOperations, Fi
|
||||
progress.cancel()
|
||||
}
|
||||
completionHandler(nil, serverError)
|
||||
self.delegateNotify(operation, error: nil)
|
||||
self.delegateNotify(operation)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@@ -365,7 +365,7 @@ open class LocalFileProvider: FileProvider, FileProviderMonitor, FileProvideUndo
|
||||
self.dispatch_queue.async {
|
||||
completionHandler?(nil)
|
||||
}
|
||||
self.delegateNotify(operation, error: nil)
|
||||
self.delegateNotify(operation)
|
||||
} catch let e {
|
||||
if successfulSecurityScopedResourceAccess {
|
||||
source.stopAccessingSecurityScopedResource()
|
||||
@@ -432,7 +432,7 @@ open class LocalFileProvider: FileProvider, FileProviderMonitor, FileProvideUndo
|
||||
self.dispatch_queue.async {
|
||||
completionHandler(data, nil)
|
||||
}
|
||||
self.delegateNotify(operation, error: nil)
|
||||
self.delegateNotify(operation)
|
||||
} catch let e {
|
||||
progress.cancel()
|
||||
self.dispatch_queue.async {
|
||||
@@ -523,7 +523,7 @@ open class LocalFileProvider: FileProvider, FileProviderMonitor, FileProvideUndo
|
||||
progress.completedUnitCount = progress.totalUnitCount
|
||||
self.dispatch_queue.async {
|
||||
completionHandler(data, nil)
|
||||
self.delegateNotify(operation, error: nil)
|
||||
self.delegateNotify(operation)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -607,7 +607,7 @@ open class LocalFileProvider: FileProvider, FileProviderMonitor, FileProvideUndo
|
||||
do {
|
||||
try self.opFileManager.createSymbolicLink(at: self.url(of: path), withDestinationURL: self.url(of: destPath))
|
||||
completionHandler?(nil)
|
||||
self.delegateNotify(operation, error: nil)
|
||||
self.delegateNotify(operation)
|
||||
} catch let e {
|
||||
completionHandler?(e)
|
||||
self.delegateNotify(operation, error: e)
|
||||
|
||||
@@ -70,7 +70,7 @@ open class WebDAVFileProvider: HTTPFileProvider, FileProviderSharing {
|
||||
|
||||
If the directory contains no entries or an error is occured, this method will return the empty array.
|
||||
|
||||
- Parameter path: path to target directory. If empty, `currentPath` value will be used.
|
||||
- Parameter path: path to target directory. If empty, root will be iterated.
|
||||
- Parameter including: An array which determines which file properties should be considered to fetch.
|
||||
- Parameter completionHandler: a closure with result of directory entries or error.
|
||||
- `contents`: An array of `FileObject` identifying the the directory entries.
|
||||
@@ -114,7 +114,7 @@ open class WebDAVFileProvider: HTTPFileProvider, FileProviderSharing {
|
||||
|
||||
If the directory contains no entries or an error is occured, this method will return the empty `FileObject`.
|
||||
|
||||
- Parameter path: path to target directory. If empty, `currentPath` value will be used.
|
||||
- Parameter path: path to target directory. If empty, attributes of root will be returned.
|
||||
- Parameter including: An array which determines which file properties should be considered to fetch.
|
||||
- Parameter completionHandler: a closure with result of directory entries or error.
|
||||
- `attributes`: A `FileObject` containing the attributes of the item.
|
||||
|
||||
Reference in New Issue
Block a user