Class FileChunkedPacketSenderBuilder
java.lang.Object
eu.cloudnetservice.driver.network.chunk.defaults.builder.DefaultChunkedPacketSenderBuilder
eu.cloudnetservice.driver.network.chunk.defaults.builder.FileChunkedPacketSenderBuilder
- All Implemented Interfaces:
ChunkedPacketSender.Builder
Represents a builder for chunked packet sessions which are transferring files.
- Since:
- 4.0
- See Also:
-
Field Summary
Fields inherited from class eu.cloudnetservice.driver.network.chunk.defaults.builder.DefaultChunkedPacketSenderBuilder
chunkSize, DEFAULT_CHUNK_SIZE, packetSplitter, sessionUniqueId, source, transferChannel, transferInformation -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected @NonNull ChunkedPacketSenderdoBuild()Delegate method which must get overridden by any class which extends from this builder.Sets the file to transfer in the session.Methods inherited from class eu.cloudnetservice.driver.network.chunk.defaults.builder.DefaultChunkedPacketSenderBuilder
build, chunkSize, packetSplitter, sessionUniqueId, source, toChannels, toChannels, transferChannel, withExtraData
-
Constructor Details
-
FileChunkedPacketSenderBuilder
public FileChunkedPacketSenderBuilder()
-
-
Method Details
-
forFile
Sets the file to transfer in the session. The file path must exist.- Parameters:
path- the path to the file to transfer.- Returns:
- the same builder instance as used to call the method, for chaining.
- Throws:
AssertionError- if an i/o error occurs while opening the file stream.NullPointerException- if the given file path is null.
-
doBuild
Delegate method which must get overridden by any class which extends from this builder. The method is used to actually build the sender while being sure that there are no violations to the build contract (the delegation method should, but must not be assertion free).- Specified by:
doBuildin classDefaultChunkedPacketSenderBuilder- Returns:
- the sender instance build based on the information supplied to this builder.
-