[
https://issues.apache.org/jira/browse/VFS-618?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15416883#comment-15416883
]
J. Baier commented on VFS-618:
------------------------------
Here is the stack trace with 2.1:
org.apache.commons.vfs2.FileSystemException: Could not read from
"sftp://user:***@192.168.0.1/folder/file" because it is not a file.
{quote}
at
org.apache.commons.vfs2.provider.sftp.SftpFileObject.doGetInputStream(SftpFileObject.java:597)
at
org.apache.commons.vfs2.provider.AbstractFileObject.getInputStream(AbstractFileObject.java:1301)
at
org.apache.commons.vfs2.provider.DefaultFileContent.getInputStream(DefaultFileContent.java:411)
{quote}
> sftp consumes channels on each cd when directory does not exist
> ---------------------------------------------------------------
>
> Key: VFS-618
> URL: https://issues.apache.org/jira/browse/VFS-618
> Project: Commons VFS
> Issue Type: Bug
> Affects Versions: 2.1
> Environment: all platforms
> Reporter: J. Baier
> Original Estimate: 1h
> Remaining Estimate: 1h
>
> While resolving a FileObject on an sftp target for a directory that does not
> exist on the target, SftpFileSystem.getChannel() is called and while trying
> to cd to the workingDirectory, an SftpException is thrown but the channel
> object is not released.
> This leads to many sftp channels kept opoen on the target system and consumes
> unnecessary resources.
> A simple patch of releasing the channel in the caught SftpException in
> SftpFileSystem line 125 would solve this issue.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)