Merge branch 'master' into master

This commit is contained in:
evilutioner
2017-08-01 16:08:51 +03:00
committed by GitHub
3 changed files with 7 additions and 8 deletions
+1 -1
View File
@@ -19,7 +19,7 @@ public final class LocalFileObject: FileObject {
var fileURL: URL?
var rpath = path.replacingOccurrences(of: relativeURL?.path ?? "", with: "", options: .anchored)
if relativeURL != nil && rpath.hasPrefix("/") {
rpath.remove(at: rpath.startIndex)
_=rpath.characters.removeFirst()
}
if #available(iOS 9.0, macOS 10.11, tvOS 9.0, *) {
fileURL = URL(fileURLWithPath: rpath, relativeTo: relativeURL)
+5 -6
View File
@@ -213,18 +213,18 @@ open class OneDriveFileProvider: FileProviderBasicRemote {
rpath = self.currentPath
}
let driveURL = baseURL!.appendingPathComponent("drive/\(drive):/")
if rpath.hasPrefix("/") {
rpath.remove(at: rpath.startIndex)
_=rpath.characters.removeFirst()
}
if rpath.isEmpty {
if let modifier = modifier {
return baseURL!.appendingPathComponent("drive/\(drive)/\(modifier)")
return driveURL.appendingPathComponent(modifier)
}
return baseURL!.appendingPathComponent("drive/\(drive)")
return driveURL
}
let driveURL = baseURL!.appendingPathComponent("drive/\(drive):/")
// fixed, multiple PercentEncoding
//rpath = (rpath.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? rpath)
rpath = rpath.trimmingCharacters(in: pathTrimSet)
if let modifier = modifier {
rpath = rpath + ":/" + modifier
@@ -250,7 +250,6 @@ open class OneDriveFileProvider: FileProviderBasicRemote {
extension OneDriveFileProvider: FileProviderOperations {
open func create(folder folderName: String, at atPath: String, completionHandler: SimpleCompletionHandler) -> OperationHandle? {
let path = (atPath as NSString).appendingPathComponent(folderName) + "/"
return doOperation(.create(path: path), completionHandler: completionHandler)
+1 -1
View File
@@ -22,7 +22,7 @@ public final class OneDriveFileObject: FileObject {
// var rpath = path.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? path
var rpath = (URL(string:path)?.appendingPathComponent(name).absoluteString)!
if rpath.hasPrefix("/") {
rpath.remove(at: rpath.startIndex)
_=rpath.characters.removeFirst()
}
let url = URL(string: rpath, relativeTo: baseURL) ?? URL(string: rpath)!