1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.commons.vfs2.provider.ftp;
18
19 import org.apache.ftpserver.command.CommandFactory;
20 import org.apache.ftpserver.command.CommandFactoryFactory;
21 import org.apache.ftpserver.ftplet.FtpReply;
22 import org.apache.ftpserver.impl.FtpReplyTranslator;
23 import org.apache.ftpserver.impl.LocalizedFtpReply;
24
25 import junit.framework.Test;
26
27 public class FtpProviderMdtmOffTestCase extends FtpProviderTestCase {
28
29 public static Test suite() throws Exception {
30 return suite(new FtpProviderTestCase(false), FtpMdtmOffLastModifiedTests.class);
31 }
32
33
34
35
36
37 @Override
38 protected CommandFactory getCommandFactory() {
39 final CommandFactoryFactory factory = new CommandFactoryFactory();
40 final String commandName = "FEAT";
41 factory.addCommand(commandName, (session, context, request) -> {
42 session.resetState();
43
44 final String replyMsg = FtpReplyTranslator.translateMessage(session, request, context,
45 FtpReply.REPLY_211_SYSTEM_STATUS_REPLY, commandName, null);
46 final LocalizedFtpReply reply = new LocalizedFtpReply(FtpReply.REPLY_211_SYSTEM_STATUS_REPLY,
47 replyMsg.replaceFirst(" MDTM\\n", ""));
48
49 session.write(reply);
50 });
51 return factory.createCommandFactory();
52 }
53 }