[ https://issues.apache.org/jira/browse/SSHD-1240 ]
dgü deleted comment on SSHD-1240:
---------------------------
was (Author: JIRAUSER284065):
Hello!
This is another question encountered in SSHD-1238.
I created URI instances with wrong passwords. But, It worked. The code:
{noformat}
*/
public static void main(String[] args) throws IOException,
URISyntaxException {
// Correct user info
URI uri = new URI("sftp://deneme:[email protected]:22");
try (FileSystem fs = FileSystems.newFileSystem(uri,
Collections.<String, Object>emptyMap())) {
// Wrong password
Path sourceFile = Paths.get(new
URI("sftp://deneme:[email protected]:22/C:/Users/XXX/Desktop/sil/sftp/sil1.txt"));
// Wrong password
Path targetFile = Paths.get(new
URI("sftp://deneme:[email protected]:22/C:/Users/XXX/Desktop/sil/sftp/sil2.txt"));
Files.copy(sourceFile, targetFile,
StandardCopyOption.REPLACE_EXISTING);
}
}
{noformat}
is this expected behaviour? I guess URI in _Paths.get_ matches only
host:port:user with URI in _FileSystems.newFileSystem_
Thanks in advance!
> Wrong password in URI works
> ---------------------------
>
> Key: SSHD-1240
> URL: https://issues.apache.org/jira/browse/SSHD-1240
> Project: MINA SSHD
> Issue Type: Request
> Affects Versions: 2.8.0
> Reporter: dgü
> Priority: Major
>
> Hello!
> This is another question encountered in SSHD-1238.
> I created URI instances with wrong passwords. But, It worked. The code:
> {noformat}
> */
> public static void main(String[] args) throws IOException,
> URISyntaxException {
> // Correct user info
> URI uri = new URI("sftp://deneme:[email protected]:22");
> try (FileSystem fs = FileSystems.newFileSystem(uri,
> Collections.<String, Object>emptyMap())) {
> // Wrong password
> Path sourceFile = Paths.get(new
> URI("sftp://deneme:[email protected]:22/C:/Users/XXX/Desktop/sil/sftp/sil1.txt"));
> // Wrong password
> Path targetFile = Paths.get(new
> URI("sftp://deneme:[email protected]:22/C:/Users/XXX/Desktop/sil/sftp/sil2.txt"));
> Files.copy(sourceFile, targetFile,
> StandardCopyOption.REPLACE_EXISTING);
> }
> }
> {noformat}
>
> is this expected behaviour? I guess URI in _Paths.get_ matches only
> host:port:user with URI in _FileSystems.newFileSystem_
> Thanks in advance!
>
--
This message was sent by Atlassian Jira
(v8.20.1#820001)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]