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

Guillaume Nodet resolved SSHD-1238.
-----------------------------------
      Assignee: Guillaume Nodet
    Resolution: Not A Problem

> 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-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org

Reply via email to