When doing a rename, consider the line:

LOG.info("File rename (" + session.getUser().getName() + ") "
                        + frFile.getAbsolutePath() + " -> " +
toFile.getAbsolutePath());

This log statement asks for the absolute path for the frFile. But this file
has just been moved. For the sake of the log statement you need to save the
value for frFile.getAbsolutePath() and then log it AFTER the rename has been
complete.

e.g.

            // now rename
                String logFrFileAbsolutePath = frFile.getAbsolutePath();

            if (frFile.move(toFile)) {
                session.write(LocalizedFtpReply.translate(session, request,
context,
                        FtpReply.REPLY_250_REQUESTED_FILE_ACTION_OKAY,
"RNTO",
                        toFileStr));

                LOG.info("File rename (" + session.getUser().getName() + ")
"
                        + logFrFileAbsolutePath + " -> " +
toFile.getAbsolutePath());

Let me know your thoughts, thanks

Dan

Reply via email to