Interface ChunkedPacketSender
- All Superinterfaces:
ChunkedPacketProvider
A sender of chunked data in any form. It is responsible to transfer all data chunks to the target network component
of the transfer.
- Since:
- 4.0
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceA builder for a chunked packet sender, holding all general options. -
Method Summary
Modifier and TypeMethodDescriptionstatic ChunkedPacketSender.BuilderforFileTransfer(@NonNull Path filePath) Get a new builder for a packet sender which allows to transfer a single but huge file, e.g.static ChunkedPacketSender.BuilderGet a new builder for a packet sender which allows to transfer a stream of data in chunks through the network.Transfers the data from the data source to all targets of this sender.Methods inherited from interface eu.cloudnetservice.driver.network.chunk.ChunkedPacketProvider
sessionInformation, transferStatus
-
Method Details
-
forStreamTransfer
Get a new builder for a packet sender which allows to transfer a stream of data in chunks through the network.- Returns:
- a builder for a chunked data transfer.
-
forFileTransfer
Get a new builder for a packet sender which allows to transfer a single but huge file, e.g. a zip folder in chunks through the network.- Parameters:
filePath- the path to the file that should be transferred.- Returns:
- a builder for file based chunked packet transfer.
- Throws:
NullPointerException- if the given file path is null.IllegalArgumentException- if the given file path cannot be opened for reading.
-
transferChunkedData
Transfers the data from the data source to all targets of this sender. The returned future is completed when:- The transfer completed successfully.
- The transfer failed for any reason. The returned task will be completed holding the reason exception.
- Returns:
- a future completed when the transfer finishes.
-