diff --git a/FilesProvider.podspec b/FilesProvider.podspec index 46e481d..e05e420 100644 --- a/FilesProvider.podspec +++ b/FilesProvider.podspec @@ -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. diff --git a/FilesProvider.xcodeproj/project.pbxproj b/FilesProvider.xcodeproj/project.pbxproj index 9e4102e..b315fea 100644 --- a/FilesProvider.xcodeproj/project.pbxproj +++ b/FilesProvider.xcodeproj/project.pbxproj @@ -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; diff --git a/Sources/CloudFileProvider.swift b/Sources/CloudFileProvider.swift index 4282787..2c7c60c 100644 --- a/Sources/CloudFileProvider.swift +++ b/Sources/CloudFileProvider.swift @@ -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() diff --git a/Sources/FPSStreamTask.swift b/Sources/FPSStreamTask.swift index 9f4e18c..4076e25 100644 --- a/Sources/FPSStreamTask.swift +++ b/Sources/FPSStreamTask.swift @@ -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) diff --git a/Sources/FTPFileProvider.swift b/Sources/FTPFileProvider.swift index cb65cfd..165f5b6 100644 --- a/Sources/FTPFileProvider.swift +++ b/Sources/FTPFileProvider.swift @@ -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() } diff --git a/Sources/FileProvider.swift b/Sources/FileProvider.swift index 85a9309..3562994 100644 --- a/Sources/FileProvider.swift +++ b/Sources/FileProvider.swift @@ -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) diff --git a/Sources/HTTPFileProvider.swift b/Sources/HTTPFileProvider.swift index 5474389..8b34d24 100644 --- a/Sources/HTTPFileProvider.swift +++ b/Sources/HTTPFileProvider.swift @@ -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 } diff --git a/Sources/LocalFileProvider.swift b/Sources/LocalFileProvider.swift index 915d117..5c7780f 100644 --- a/Sources/LocalFileProvider.swift +++ b/Sources/LocalFileProvider.swift @@ -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) diff --git a/Sources/WebDAVFileProvider.swift b/Sources/WebDAVFileProvider.swift index 177377e..0f1b460 100644 --- a/Sources/WebDAVFileProvider.swift +++ b/Sources/WebDAVFileProvider.swift @@ -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.