Details
-
Improvement
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
2.5.1
-
None
Description
The current code requires closing the session separately from any "sub-interface" that use it - e.g.:
try (ClientSession session = ...obtain a session...;
SftpClient sftp = ...obtain client(session)...) {
... use SFTP client ...
}
In some cases we may want to expose only the "sub-interface" and have it automatically close the underlying session when the "sub-interface" is closed. E.g.;
// The session is also closed when SFTP client is closed try (SftpClient sftp = createSftpClient(...)) { ... use SFTP client ... } SftpClient createSftpClient(....) { ClientSession session = ...obtain a session...; SftpClient sftp = ...obtain client(session)...; return wrapAsCloseable(sftp, session); }
Attachments
Issue Links
- links to