Details
Description
From the documentation mina-sshd ,
URI uri = SftpFileSystemProvider.createFileSystemURI(host, port, username, password);
if username or password parameters contain a character '@' , for example,
username = "J@ck"; password = "d@Ripper";
then the resulting URI has hostname null ,because
SftpFileSystemProvider.createSystemURI
internally uses
URI.create(sb.ToString)
which does not handle this. To solve this, URI constructor should be used as suggested in the answer here .
String userInfo = userName + ":" + password; String path = remoteDirectory + filename; // Need a '/' between them? URI sftpUri = new URI("sftp", userInfo, remoteServerAddress, portNo, null, null, null);