// get password from console.
String password = ConsoleUtil.readRequiredData("password");
try {
VfsService vfsService = VfsContext.getService();
session.setSessionID(vfsService.login(loginName, password));
String sessionID = session.getSessionID();
VfsFile home = vfsService.getVfsFile(sessionID, "-1", "Home");
if (home == null)
throw new IllegalStateException(
"User home directory not found.");