From a077d000bc67cdc180d4b98de1aea0ee2cb76ab8 Mon Sep 17 00:00:00 2001 From: Amir Abbas Mousavian Date: Sun, 31 Jul 2016 01:27:13 +0430 Subject: [PATCH] Updated Readme --- FileProvider.xcodeproj/project.pbxproj | 13 ++++++++----- README.md | 17 +++++++++++++---- Sources/LocalFileProvider.swift | 1 + Sources/SMBTypes/SMB2IOCtl.swift | 3 ++- Sources/SMBTypes/SMB2Query.swift | 2 ++ 5 files changed, 26 insertions(+), 10 deletions(-) diff --git a/FileProvider.xcodeproj/project.pbxproj b/FileProvider.xcodeproj/project.pbxproj index fd8cb14..520ef5a 100644 --- a/FileProvider.xcodeproj/project.pbxproj +++ b/FileProvider.xcodeproj/project.pbxproj @@ -170,16 +170,16 @@ isa = PBXGroup; children = ( 7993969A1D48C02300086753 /* CIFSTypes.swift */, + 799396A41D48C02300086753 /* SMBErrorType.swift */, 7993969B1D48C02300086753 /* SMB2DataTypes.swift */, - 7993969C1D48C02300086753 /* SMB2FileHandle.swift */, + 799396A31D48C02300086753 /* SMB2Types.swift */, + 799396A21D48C02300086753 /* SMB2Tree.swift */, + 799396A01D48C02300086753 /* SMB2Session.swift */, 7993969D1D48C02300086753 /* SMB2FileOperation.swift */, + 7993969C1D48C02300086753 /* SMB2FileHandle.swift */, 7993969E1D48C02300086753 /* SMB2IOCtl.swift */, 7993969F1D48C02300086753 /* SMB2Query.swift */, - 799396A01D48C02300086753 /* SMB2Session.swift */, 799396A11D48C02300086753 /* SMB2SetInfo.swift */, - 799396A21D48C02300086753 /* SMB2Tree.swift */, - 799396A31D48C02300086753 /* SMB2Types.swift */, - 799396A41D48C02300086753 /* SMBErrorType.swift */, ); path = SMBTypes; sourceTree = ""; @@ -778,6 +778,7 @@ 7993966E1D48B7F600086753 /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; 7993967A1D48B80D00086753 /* Build configuration list for PBXNativeTarget "FileProvider OSX" */ = { isa = XCConfigurationList; @@ -786,6 +787,7 @@ 7993967C1D48B80D00086753 /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; 799396871D48B82700086753 /* Build configuration list for PBXNativeTarget "FileProvider tvOS" */ = { isa = XCConfigurationList; @@ -794,6 +796,7 @@ 799396891D48B82700086753 /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; diff --git a/README.md b/README.md index cdd9183..7c4bc2e 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ Local and WebDAV providers are fully tested and can be used in production enviro ## Requirements -- **Swift 2.2** +- **Swift 2.2 or 2.3** - iOS 8.0 , OSX 10.10 - XCode 7.3 @@ -81,7 +81,9 @@ You can't change the base url later. and all paths are related to this base url For remote file providers authentication may be necessary: let credential = NSURLCredential(user: "user", password: "pass", persistence: NSURLCredentialPersistence.Permanent) - let webdavProvider = WebDAVFileProvider(baseURL: "http://www.example.com/dav", credential: credential) + let webdavProvider = WebDAVFileProvider(baseURL: NSURL(string: "http://www.example.com/dav")!, credential: credential) + +* In case you want to connect non-secure servers for WebDAV (http) in iOS 9+ / macOS 10.11+ you should disable App Transport Security (ATS) according to [this guide.](https://gist.github.com/mlynch/284699d676fe9ed0abfa) * For Dropbox, user is clientID and password is Token which both must be retrieved via [OAuth2 API of Dropbox](https://www.dropbox.com/developers/reference/oauth-guide). There are libraries like [p2/OAuth2](https://github.com/p2/OAuth2) or [OAuthSwift](https://github.com/OAuthSwift/OAuthSwift) which can facilate the procedure to retrieve token. @@ -211,7 +213,7 @@ Move file old.txt to new.txt in current path: ### Retrieve Content of File -THere is two method for this purpose, one of them loads entire file into NSData and another can load a portion of file. +There is two method for this purpose, one of them loads entire file into NSData and another can load a portion of file. documentsProvider.contentsAtPath(path: "old.txt", completionHandler: { (contents: NSData?, error: ErrorType?) -> Void @@ -252,6 +254,13 @@ You can monitor updates in some file system (Local and SMB2), there is three met We would love for you to contribute to **FileProvider**, check the `LICENSE` file for more info. +## Projects in use + +* [EDM - Browse and Receive Files](https://itunes.apple.com/us/app/edm-browse-and-receive-files/id948397575?ls=1&mt=8) +* [File Manager - PDF Reader & Music Player](https://itunes.apple.com/us/app/file-manager-pdf-reader-music/id1017809685?ls=1&mt=8) + +If you used this library in your project, you can open an issue to inform us. + ## Meta Amir-Abbas Mousavian – [@amosavian](https://twitter.com/amosavian) @@ -260,7 +269,7 @@ Distributed under the MIT license. See `LICENSE` for more information. [https://github.com/yourname/github-link](https://github.com/dbader/) -[swift-image]:https://img.shields.io/badge/swift-2.2-green.svg +[swift-image]:https://img.shields.io/badge/swift-2.2%2C%202.3-green.svg [swift-url]: https://swift.org/ [license-image]: https://img.shields.io/badge/License-MIT-blue.svg [license-url]: LICENSE diff --git a/Sources/LocalFileProvider.swift b/Sources/LocalFileProvider.swift index 619b944..371b071 100644 --- a/Sources/LocalFileProvider.swift +++ b/Sources/LocalFileProvider.swift @@ -324,6 +324,7 @@ public class LocalFileProvider: FileProvider, FileProviderMonitor { for (i, monitor) in monitors.enumerate() { if self.relativePathOf(url: monitor.url) == path { removedMonitor = monitors.removeAtIndex(i) + break } } removedMonitor?.stop() diff --git a/Sources/SMBTypes/SMB2IOCtl.swift b/Sources/SMBTypes/SMB2IOCtl.swift index 63967c6..253aa74 100644 --- a/Sources/SMBTypes/SMB2IOCtl.swift +++ b/Sources/SMBTypes/SMB2IOCtl.swift @@ -243,11 +243,12 @@ extension SMB2 { // SRV_ENUMERATE_SNAPSHOTS struct SrvSnapshots: IOCtlResponseProtocol { let count: UInt32 + let returnedCount: UInt32 let snapshots: [SMBTime] init?(data: NSData) { self.count = decode(data) - let returnedCount: UInt32 = decode(data.subdataWithRange(NSRange(location: 4, length: 4))) + self.returnedCount = decode(data.subdataWithRange(NSRange(location: 4, length: 4))) //let size: UInt32 = decode(data.subdataWithRange(NSRange(location: 8, length: 4))) var snapshots = [SMBTime]() let dateFormatter = NSDateFormatter() diff --git a/Sources/SMBTypes/SMB2Query.swift b/Sources/SMBTypes/SMB2Query.swift index 0026d6f..d7cdc9a 100644 --- a/Sources/SMBTypes/SMB2Query.swift +++ b/Sources/SMBTypes/SMB2Query.swift @@ -11,6 +11,8 @@ import Foundation extension SMB2 { // MARK: SMB2 Query Directory + + // MARK: SMB2 Change Notify // MARK: SMB2 Query Info