Interface Connection
public interface Connection
Represents a connection to a file transfer endpoint.
The connection can be used for either an upload or a download operation, but not both. Provides a channel for data transfer and methods to complete and close the connection.
- Since:
- 2022-06-14
-
Method Details
-
getChannel
Channel getChannel()- Returns:
- Returns the channel that can be used to read or write data (whether read or write is enabled depends on if you requested a download or an upload).
-
done
Called when the transfer has ended (from the clients point of view). The connection can now validate with the server that everything is OK. E.g., in case of an upload this is where we confirm that the file was uploaded correctly onto the server.- Throws:
IOException- If the transfer should fail.
-
close
Close the connection. This will release any resources consumed by this connection.- Throws:
IOException- If unable to close the connection.
-