I have used VirtualFileSystemFactory(Paths.get(“/hello”)) to show the logical folder “hello”. But, this folder is really not existed in my filesystem. Due to this, getting exception as not a valid directory. I have to show the “/hello” as a logical directory from in-memory. I am using windows machine to test this.
Please let me know how can we achieve this.
sshServer.setPort(port);
sshServer.setPasswordAuthenticator(dynamicPasswordAuthenticator()); // returning true
sshServer.setFileSystemFactory(new VirtualFileSystemFactory(Paths.get("/hello")));
sshServer.setSubsystemFactories(Collections.singletonList(new SftpSubsystemFactory()));
SftpSubsystemFactory factory = new SftpSubsystemFactory.Builder().build();
sshServer.setSubsystemFactories(Collections.singletonList(factory));