You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "dgü (Jira)" <ji...@apache.org> on 2022/01/24 20:20:00 UTC

[jira] [Closed] (SSHD-1238) java.nio.file.FileSystemNotFoundException by SftpFileSystemProvider.getFileSystem

     [ https://issues.apache.org/jira/browse/SSHD-1238?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

dgü closed SSHD-1238.
---------------------

I guess it would be better to update _Using SftpFileSystemProvider to create an SftpFileSystem_ section at [https://github.com/apache/mina-sshd/blob/master/docs/sftp.md] explaining that java.nio.file.FileSystem is need to create.

Thank you for the clear answer.

> java.nio.file.FileSystemNotFoundException by SftpFileSystemProvider.getFileSystem
> ---------------------------------------------------------------------------------
>
>                 Key: SSHD-1238
>                 URL: https://issues.apache.org/jira/browse/SSHD-1238
>             Project: MINA SSHD
>          Issue Type: Request
>    Affects Versions: 2.8.0
>         Environment: Java SE 8, Apache NetBeans IDE 12.5
>            Reporter: dgü
>            Assignee: Guillaume Nodet
>            Priority: Major
>
> Hello!
> The following code runs successfully:
> {noformat}
>     public static void main(String[] args) throws IOException  {
>         URI uri = SftpFileSystemProvider.createFileSystemURI("127.0.0.1", 22, "deneme", "deneme123");
>         try (FileSystem fs = FileSystems.newFileSystem(uri, Collections.<String, Object>emptyMap())) {
>             Path localPath = fs.getPath("C:/Users/XXX/Desktop/sil/sftp/sil1.txt");
>             Path targetPath = fs.getPath("C:/Users/XXX/Desktop/sil/sftp/sil2.txt");
>             Files.copy(localPath, targetPath, StandardCopyOption.REPLACE_EXISTING);
>         }
>     }
> {noformat}
> The following code fails:
> {noformat}
>     public static void main(String[] args) throws URISyntaxException  {
>         Path sourceFile = Paths.get(new URI("sftp://deneme:deneme123@127.0.0.1/C:/Users/XXX/Desktop/sil/sftp/sil.txt"));
>     }
> {noformat}
> The exeption is:
> {noformat}
> Exception in thread "main" java.nio.file.FileSystemNotFoundException: 127.0.0.1:22:deneme
> 	at org.apache.sshd.sftp.client.fs.SftpFileSystemProvider.getFileSystem(SftpFileSystemProvider.java:451)
> 	at org.apache.sshd.sftp.client.fs.SftpFileSystemProvider.getPath(SftpFileSystemProvider.java:492)
> 	at java.nio.file.Paths.get(Paths.java:143)
> 	at com.ubtools.ubutils.UBTest.main(UBTest.java:30)
> {noformat}
>  
> How can I solve this problem ?
> Thanks!



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

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