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

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

Introduction

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

Prototype

@Fluent
FileSystem copyBlocking(String from, String to);

Source Link

Document

Blocking version of #copy(String,String,Handler)

Usage

From source file:de.braintags.netrelay.controller.filemanager.elfinder.command.impl.AbstractCommand.java

License:Open Source License

/**
 * Copy the file or folder to the destination
 * /*  www.  j a  v  a 2  s.  c om*/
 * @param src
 * @param dst
 * @throws IOException
 */
protected void createAndCopy(ITarget src, ITarget dst) {
    FileSystem fs = src.getVolume().getFileSystem();
    if (src.isFolder()) {
        fs.copyRecursiveBlocking(src.getAbsolutePath(), dst.getAbsolutePath(), true);
    } else {
        fs.copyBlocking(src.getAbsolutePath(), dst.getAbsolutePath());
    }
}

From source file:examples.FileSystemExamples.java

License:Open Source License

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

    // Copy file from foo.txt to bar.txt synchronously
    fs.copyBlocking("foo.txt", "bar.txt");
}