[
https://issues.apache.org/jira/browse/DIRMINA-1097?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16681312#comment-16681312
]
Emmanuel Lecharny commented on DIRMINA-1097:
--------------------------------------------
This is not a MINA issue, but a SSHD one.
I will move the ticket to SSHD.
> Handling extra '@' present in username,password while creating
> SftpFileSystemProvider.createFileSystemURI
> ---------------------------------------------------------------------------------------------------------
>
> Key: DIRMINA-1097
> URL: https://issues.apache.org/jira/browse/DIRMINA-1097
> Project: MINA
> Issue Type: Bug
> Affects Versions: 2.0.0
> Environment: Dell Laptop,
> Intel i5-7200U 8gb RAM
> Windows 10 pro 64-bit
> Reporter: Mohammed Salman
> Priority: Critical
> Labels: easyfix
> Original Estimate: 72h
> Remaining Estimate: 72h
>
> From the documentation
> [mina-sshd|https://github.com/apache/mina-sshd/blob/master/README.md] ,
> {code:java}
> URI uri = SftpFileSystemProvider.createFileSystemURI(host, port, username,
> password);
> {code}
> if username or password parameters contain a character '@' , for example,
>
>
> {code:java}
> username = "J@ck";
> password = "d@Ripper";
> {code}
> then the resulting URI has hostname null ,because
> {code:java}
> SftpFileSystemProvider.createSystemURI{code}
> internally uses
> {code:java}
> URI.create(sb.ToString) {code}
> which does not handle this. To solve this, URI constructor should be used as
> suggested in the answer
> [here|https://stackoverflow.com/questions/26450910/java-sftp-apache-vfs2-password-with]
> .
>
> {code:java}
> String userInfo = userName + ":" + password; String path = remoteDirectory +
> filename; // Need a '/' between them? URI sftpUri = new URI("sftp", userInfo,
> remoteServerAddress, portNo, null, null, null);{code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)