I'm trying to create an sftp client using Apache Commons VFS. I would like to connect to a user's home directory first and allow the user to navigate all the directories on the server. If I set UserDirIsRoot to true:
SftpFileSystemConfigBuilder.getInstance().setUserDirIsRoot(opts, true);
It will connect to current user's home directory but it does not allow the user to navigate to any parent directories since the home dir is already the root.
If I set UserDirIsRoot to false, I will have to provide a starting directory path. I am trying to avoid requiring user to provide an initial directory path.
Is there a way to find out a user's home directory path (absolute path on the server)?
Thank you!