You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "Guillaume Nodet (Jira)" <ji...@apache.org> on 2020/09/23 09:50:00 UTC

[jira] [Comment Edited] (SSHD-1086) Base dir doesn’t exist issue

    [ https://issues.apache.org/jira/browse/SSHD-1086?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17200696#comment-17200696 ] 

Guillaume Nodet edited comment on SSHD-1086 at 9/23/20, 9:49 AM:
-----------------------------------------------------------------

The problem is that {{new File(fullPathNoEndSeparator)}} will return a local file.  If you want to scan the remote file system using SFTP, you need to use :
{code:java}
FileSystem fs = SftpClientFactory.instance().createSftpFileSystem(session);

...
ds.setBaseDir(fs.getPath(fullPathNoEndSeparator);{code}
No need to create the {{SftpClient}}, just use an {{ClientSession}}.


was (Author: gnt):
I think {{(*new* File(fullPathNoEndSeparator)}} will return a local file.  If you want to scan the remote file system using SFTP, you need to use :


{code:java}
FileSystem fs = SftpClientFactory.instance().createSftpFileSystem(session);

...
ds.setBaseDir(fs.getPath(fullPathNoEndSeparator);{code}
No need to create the {{SftpClient}}, just use an {{ClientSession}}.

> Base dir doesn’t exist issue
> ----------------------------
>
>                 Key: SSHD-1086
>                 URL: https://issues.apache.org/jira/browse/SSHD-1086
>             Project: MINA SSHD
>          Issue Type: Bug
>    Affects Versions: 2.1.0
>            Reporter: Netram
>            Priority: Major
>         Attachments: 309002D7-B870-410D-B4A0-A1683166298A.jpeg
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> I am getting base dir doesn’t exist error message.
> This error is throwing from ds.scan() method.
> This is working in local env not working in remote server.
> Please see the attached code.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org
For additional commands, e-mail: dev-help@mina.apache.org