I use Apache Mina Sshd API to start up a local SFTP server in java.In SFTP client i use Jcraft jsch API to create my SFTP client.I successf
In Default it takes the root path from System property called user.dir
Inorder to change this, you can override getVirtualUserDir() in NativeFileSystemView and return your path.
sshd.setFileSystemFactory(new NativeFileSystemFactory() {
@Override
public FileSystemView createFileSystemView(final Session session) {
return new NativeFileSystemView(session.getUsername(), false) {
@Override
public String getVirtualUserDir() {
return "C:\\MyRoot";
}
};
};
});