file.close(new AsyncResultHandler<Void>() {
public void handle(AsyncResult<Void> ar) {
if (ar.succeeded()) {
req.response().end();
long end = System.currentTimeMillis();
System.out.println("Uploaded " + pump.bytesPumped() + " bytes to " + filename + " in " + (end - start) + " ms");
} else {
ar.cause().printStackTrace(System.err);
}
}
});