if (request.hasArgument()) {
dirName = request.getArgument();
}
// change directory
FileSystemView fsview = session.getFileSystemView();
boolean success = false;
try {
success = fsview.changeWorkingDirectory(dirName);
} catch (Exception ex) {
LOG.debug("Failed to change directory in file system", ex);
}
FtpFile cwd = fsview.getWorkingDirectory();
if (success) {
dirName = cwd.getAbsolutePath();
session.write(LocalizedFileActionFtpReply.translate(session, request, context,
FtpReply.REPLY_250_REQUESTED_FILE_ACTION_OKAY, "CWD",
dirName, cwd));