}
String userName = argument.substring(spIndex + 1);
// check the user existance
UserManager usrManager = context.getUserManager();
User user = null;
try {
if (usrManager.doesExist(userName)) {
user = usrManager.getUserByName(userName);
}
} catch (FtpException ex) {
LOG.debug("Exception trying to get user from user manager", ex);
user = null;
}
if (user == null) {
session.write(LocalizedFtpReply.translate(session, request, context,
FtpReply.REPLY_501_SYNTAX_ERROR_IN_PARAMETERS_OR_ARGUMENTS,
"SITE.DESCUSER", userName));
return;
}
// send the user information
StringBuffer sb = new StringBuffer(128);
sb.append("\n");
sb.append("userid : ").append(user.getName()).append("\n");
sb.append("userpassword : ********\n");
sb.append("homedirectory : ").append(user.getHomeDirectory()).append(
"\n");
sb.append("writepermission : ").append(
user.authorize(new WriteRequest()) != null).append("\n");
sb.append("enableflag : ").append(user.getEnabled()).append("\n");
sb.append("idletime : ").append(user.getMaxIdleTime()).append(
"\n");
TransferRateRequest transferRateRequest = new TransferRateRequest();
transferRateRequest = (TransferRateRequest) session.getUser()
.authorize(transferRateRequest);