Examples of AsyncFile


Examples of org.vertx.java.core.file.AsyncFile

    // For a chunked upload you don't need to specify size, just do:
    // req.setChunked(true);

    vertx.fileSystem().open(filename, new AsyncResultHandler<AsyncFile>() {
      public void handle(AsyncResult<AsyncFile> ar) {
        final AsyncFile file = ar.result;
        Pump pump = Pump.createPump(file.getReadStream(), req);
        pump.start();

        file.getReadStream().endHandler(new SimpleHandler() {
          public void handle() {

            file.close(new AsyncResultHandler<Void>() {
              public void handle(AsyncResult<Void> ar) {
                if (ar.exception == null) {
                  req.end();
                  System.out.println("Sent request");
                } else {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.