/** * Extracts the working directory of the current session to an absolute file system path * (contrary to what {@link FileSystemView#getWorkingDirectory() returns, which is relative to * the user's home dir}) */ private File workingDir(FtpSession session) throws FtpException { FtpFile workingDirectory = session.getFileSystemView().getWorkingDirectory(); String home = session.getUser().getHomeDirectory(); String absolutePath = workingDirectory.getAbsolutePath().substring(1); File workingDir = new File(new File(home), absolutePath); return workingDir; }
/** * Execute command */ public void execute(final FtpIoSession session, final FtpServerContext context, final FtpRequest request) throws IOException, FtpException { session.resetState(); FileSystemView fsview = session.getFileSystemView(); String currDir = fsview.getWorkingDirectory().getAbsolutePath(); session.write(LocalizedFtpReply.translate(session, request, context, FtpReply.REPLY_257_PATHNAME_CREATED, "PWD", currDir)); }
if (fsView != null) { try { varVal = fsView.getWorkingDirectory().getAbsolutePath();
LOG.debug("Failed to change directory in file system", ex); FtpFile cwd = fsview.getWorkingDirectory(); if (success) { String dirName = cwd.getAbsolutePath();
LOG.debug("Failed to change directory in file system", ex); FtpFile cwd = fsview.getWorkingDirectory(); if (success) { dirName = cwd.getAbsolutePath();
FtpFile cwd = session.getFileSystemView().getWorkingDirectory(); if(file.equals(cwd)) { session.write(LocalizedFileActionFtpReply.translate(session, request, context,