/** * Same as {@link io.vertx.rxjava.core.file.AsyncFile#flush} but the handler will be called when the flush is complete or if an error occurs * @return * @deprecated use {@link #rxFlush} instead */ @Deprecated() public Observable<Void> flushObservable() { io.vertx.rx.java.ObservableFuture<Void> handler = io.vertx.rx.java.RxHelper.observableFuture(); flush(handler.toHandler()); return handler; }
/** * Same as {@link io.vertx.rxjava.core.file.AsyncFile#flush} but the handler will be called when the flush is complete or if an error occurs * @return */ public Single<Void> rxFlush() { return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { flush(fut); })); }
/** * Same as {@link io.vertx.rxjava.core.file.AsyncFile#flush} but the handler will be called when the flush is complete or if an error occurs * @return */ public Single<Void> rxFlush() { return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { flush(fut); })); }
return doDownload(downloadUrl, file) .doAfterTerminate(() -> { file.flush(); file.close(); })