Package com.cloud.serverpak.handlers
Class ReqFileHandler
java.lang.Object
com.cloud.serverpak.handlers.ReqFileHandler
File request message listener class. Defines a method for work
with a message containing the file data.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final intByte array buffer for the message object.private ExecutorServiceA link to the thread pool from the main listener.private FilesInformServiceFile information service.private MainHandlerNetty's main listener. -
Constructor Summary
ConstructorsConstructorDescriptionReqFileHandler(MainHandler mainHandler) The constructor saves a link to the main message listener -
Method Summary
Modifier and TypeMethodDescriptionvoidreqFileHandle(io.netty.channel.ChannelHandlerContext ctx, Object msg) Processes a request from the client to receive a file if the file weighs more than 10 mb, cuts it into 10 mb pieces. and sends it to the client.
-
Field Details
-
BUF_SIZE
private static final int BUF_SIZEByte array buffer for the message object.- See Also:
-
mainHandler
Netty's main listener.- See Also:
-
fileService
File information service.- See Also:
-
executorService
A link to the thread pool from the main listener.
-
-
Constructor Details
-
ReqFileHandler
The constructor saves a link to the main message listener. * @see FilesInformService- Parameters:
mainHandler- Netty's main listener.- See Also:
-
-
Method Details
-
reqFileHandle
Processes a request from the client to receive a file if the file weighs more than 10 mb, cuts it into 10 mb pieces. and sends it to the client.- Parameters:
ctx- channel context.msg- the message object.
-