There is a task: You need to create a client and a REST web-service in java .
The client must create an InputStream and transfer it to the service, after which every 10 seconds (or another interval is not important), add new data portions to it.
the service should have a method that takes an InputStream as an argument and outputs the received data to the log.
(You can send the service information about the number of files that will be transferred to the service, so that the service knows when it is possible to complete the data reception)
ideally, the stream should be a tar archive, and in the form of data, text files should appear in the stream ..
PS : the solution should be exactly on the InputStream:
unsuitable:
web socket solutions;
sending text files with client separate requests for service
I would be grateful for links, tips, code examples ..
InputStreamis a class in Java. Data is transmitted in the form of bytes for IS works with bytes. You need to raise theSocket(this is not a web socket) connection and send there anything. - TsyklopIS. and in the vayle read bytes and write to the openHttpUrlConnection. After each read, do aThread.sleep. - Tsyklop