MDTM handler support
Brought to you by:
chrismair
Hi Chris,
I wanna ask if it's possible to integrate a MDTM (https://tools.ietf.org/html/rfc3659#section-3) Handler. I've added an untested hacky Idea. 211 is not the ReplyCode (I think there is no) and return String is not defined. Please tell me what you think about.
best regards
Martin
public class MdtmCommandHandler extends AbstractFakeCommandHandler { private SimpleDateFormat simpleDateFormat = new SimpleDateFormat("YYYYMMDDhhmmss"); @Override protected void handle(Command command, Session session) { verifyLoggedIn(session); String path = getRealPath(session, command.getRequiredParameter(0)); String parent = getFileSystem().getParent(path); this.replyCodeForFileSystemException = ReplyCodes.READ_FILE_ERROR; verifyFileSystemCondition(getFileSystem().exists(parent), parent, "filesystem.doesNotExist"); // User must have read permission to the parent directory verifyReadPermission(session, parent); Date lastModified = getFileSystem().getEntry(path).getLastModified(); String result = simpleDateFormat.format(lastModified); sendReply(session, 211, list(result)); } }
ahhhh sorry wrong project, sorry. could someone move it to https://sourceforge.net/projects/mockftpserver/