private static String getNFSHomeDirectory() throws FileNotFoundException {
try {
if (Thread.currentThread() instanceof SshThread &&
SshThread.hasUserContext()) {
NativeAuthenticationProvider nap = NativeAuthenticationProvider.getInstance();
return nap.getHomeDirectory(SshThread.getCurrentThreadUser());
} else {
throw new FileNotFoundException("There is no user logged in");
}
} catch (IOException e) {
throw new FileNotFoundException(e.getMessage());