Example usage for io.vertx.core.file FileSystem copy

List of usage examples for io.vertx.core.file FileSystem copy

Introduction

In this page you can find the example usage for io.vertx.core.file FileSystem copy.

Prototype

Future<Void> copy(String from, String to, CopyOptions options);

Source Link

Document

Like #copy(String,String,CopyOptions,Handler) but returns a Future of the asynchronous result

Usage

From source file:examples.FileSystemExamples.java

License:Open Source License

public void example1(Vertx vertx) {
    FileSystem fs = vertx.fileSystem();

    // Copy file from foo.txt to bar.txt
    fs.copy("foo.txt", "bar.txt", res -> {
        if (res.succeeded()) {
            // Copied ok!
        } else {/*  ww  w.ja v  a2 s . co  m*/
            // Something went wrong
        }
    });
}