1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package org.waarp.ftp.core.command.rfc4217;
21
22 import org.waarp.common.command.ReplyCode;
23 import org.waarp.common.command.exception.CommandAbstractException;
24 import org.waarp.common.command.exception.Reply500Exception;
25 import org.waarp.common.command.exception.Reply534Exception;
26 import org.waarp.ftp.core.command.AbstractCommand;
27
28
29
30
31 public class CCC extends AbstractCommand {
32
33 @Override
34 public final void exec() throws CommandAbstractException {
35 if (!getSession().getConfiguration().getFtpInternalConfiguration()
36 .isAcceptAuthProt()) {
37 throw new Reply534Exception("CCC not supported");
38 }
39 if (!getSession().isSslReady()) {
40
41 throw new Reply500Exception("Session already not using SSL / TLS");
42 }
43 getSession().setSsl(false);
44 getSession().setReplyCode(ReplyCode.REPLY_200_COMMAND_OKAY, null);
45 }
46
47 }