Rename `rename` to `move`

This commit is contained in:
Zdenek Topic 2018-10-18 13:53:49 +02:00
parent 223b6d85e1
commit 6629c6cf23
No known key found for this signature in database
GPG Key ID: 41897C1A6A09DEF5
6 changed files with 6 additions and 6 deletions

View File

@ -26,7 +26,7 @@ public protocol FilesystemWriting {
func write(data: Data, to: String, on: Container, options: FileOptions?) -> Future<()>
func update(data: Data, to: String, on: Container, options: FileOptions?) -> Future<()>
func rename(file: String, to: String, on: Container, options: FileOptions?) -> Future<()>
func move(file: String, to: String, on: Container, options: FileOptions?) -> Future<()>
func copy(file: String, to: String, on: Container, options: FileOptions?) -> Future<()>
func delete(file: String, on: Container, options: FileOptions?) -> Future<()>
func delete(directory: String, on: Container, options: FileOptions?) -> Future<()>

View File

@ -44,7 +44,7 @@ extension LocalAdapter: FilesystemWriting {
}
}
open func rename(file: String, to newName: String, on worker: Container, options: FileOptions?) -> EventLoopFuture<()> {
open func move(file: String, to newName: String, on worker: Container, options: FileOptions?) -> EventLoopFuture<()> {
return run(on: worker) {
let path = self.absolutePath(to: file)
let fileURL = URL(fileURLWithPath: path)

View File

@ -43,7 +43,7 @@ extension NullAdapter: FilesystemWriting {
return worker.eventLoop.newFailedFuture(error: FilesystemError.notFound)
}
public func rename(file: String, to: String, on worker: Container, options: FileOptions?) -> EventLoopFuture<()> {
public func move(file: String, to: String, on worker: Container, options: FileOptions?) -> EventLoopFuture<()> {
return worker.eventLoop.newFailedFuture(error: FilesystemError.notFound)
}

View File

@ -35,7 +35,7 @@ extension S3Adapter: FilesystemWriting, FileOverwriteSupporting {
}
}
public func rename(file: String, to: String, on: Container, options: FileOptions?) -> EventLoopFuture<()> {
public func move(file: String, to: String, on: Container, options: FileOptions?) -> EventLoopFuture<()> {
fatalError("Not implemented.")
}

View File

@ -39,7 +39,7 @@ public extension Filesystem {
return normalize(path: file, on: worker)
.and(normalize(path: newFile, on: worker))
.flatMap { (path, newPath) in
self.adapter.rename(file: path, to: newPath, on: self.worker, options: options)
self.adapter.move(file: path, to: newPath, on: self.worker, options: options)
}
}

View File

@ -84,7 +84,7 @@ fileprivate class DummyAdapter: FilesystemAdapter {
fatalError()
}
func rename(file: String, to: String, on: Container, options: FileOptions?) -> EventLoopFuture<()> {
func move(file: String, to: String, on: Container, options: FileOptions?) -> EventLoopFuture<()> {
fatalError()
}