Methods of SFTPFileSystem operate on poolable ChannelSftp instances, thus some methods of SFTPFileSystem are chained together resulting in establishing multiple connections to the SFTP server to accomplish one compound action, those methods are listed below:
- mkdirs method
the public mkdirs method acquires a new ChannelSftp from the pool 
and then recursively creates directories, checking for the directory existence beforehand by calling the method exists which delegates to the getFileStatus(ChannelSftp channel, Path file) method  and so on until it ends up in returning the FilesStatus instance . The resource leakage occurs in the method getWorkingDirectory which calls the getHomeDirectory method  which in turn establishes a new connection to the sftp server instead of using an already created connection. As the mkdirs method is recursive this results in creating a huge number of connections.
- open method . This method returns an instance of FSDataInputStream which consumes SFTPInputStream instance which doesn't return an acquired ChannelSftp instance back to the pool but instead it closes it. This leads to establishing another connection to an SFTP server when the next method is called on the FileSystem instance.