Skip to content

Commit

Permalink
Fixed currentPath docs, delegateNotify method default error arg
Browse files Browse the repository at this point in the history
  • Loading branch information
amosavian committed Aug 28, 2017
1 parent d2a0336 commit c7201a8
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 26 deletions.
2 changes: 1 addition & 1 deletion FilesProvider.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions FilesProvider.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
8 changes: 4 additions & 4 deletions Sources/CloudFileProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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()
Expand Down
1 change: 0 additions & 1 deletion Sources/FPSStreamTask.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
14 changes: 7 additions & 7 deletions Sources/FTPFileProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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)
}
}
}
Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -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)
}
}
}
Expand Down Expand Up @@ -777,7 +777,7 @@ extension FTPFileProvider {
self.dispatch_queue.async {
completionHandler?(nil)
}
self.delegateNotify(operation, error: nil)
self.delegateNotify(operation)
})
}

Expand Down Expand Up @@ -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()
}
Expand Down
6 changes: 3 additions & 3 deletions Sources/FileProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions Sources/HTTPFileProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -371,7 +371,7 @@ open class HTTPFileProvider: FileProviderBasicRemote, FileProviderOperations, Fi
progress.cancel()
}
completionHandler(nil, serverError)
self.delegateNotify(operation, error: nil)
self.delegateNotify(operation)
return
}

Expand Down
8 changes: 4 additions & 4 deletions Sources/LocalFileProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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)
}
}

Expand Down Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions Sources/WebDAVFileProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit c7201a8

Please sign in to comment.