public class RxFile extends Object
flow()
and save(Flowable)
methods respectively.
The implementation is based on Vert.x io.vertx.reactivex.core.file.AsyncFile
.
Constructor and Description |
---|
RxFile(Path file)
Ctor.
|
RxFile(Path file,
ExecutorService exec)
Ctor.
|
Modifier and Type | Method and Description |
---|---|
io.reactivex.Completable |
delete()
Delete file.
|
io.reactivex.Flowable<ByteBuffer> |
flow()
Read file content as a flow of bytes.
|
io.reactivex.Completable |
move(Path target)
Move file to new location.
|
io.reactivex.Completable |
save(io.reactivex.Flowable<ByteBuffer> flow)
Save a flow of bytes to a file.
|
io.reactivex.Single<Long> |
size()
Get file size.
|
public RxFile(Path file)
file
- File pathpublic RxFile(Path file, ExecutorService exec)
file
- The wrapped fileexec
- IO executorpublic io.reactivex.Flowable<ByteBuffer> flow()
public io.reactivex.Completable save(io.reactivex.Flowable<ByteBuffer> flow)
flow
- The flow of bytespublic io.reactivex.Completable move(Path target)
target
- Target path the file is moved to.public io.reactivex.Completable delete()
public io.reactivex.Single<Long> size()
Copyright © 2019–2020 jcabi.com. All rights reserved.