Rename `rename` to `move`
This commit is contained in:
parent
223b6d85e1
commit
6629c6cf23
|
@ -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<()>
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
|
@ -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.")
|
||||
}
|
||||
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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()
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue