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.Reply501Exception;
25 import org.waarp.common.command.exception.Reply503Exception;
26 import org.waarp.ftp.core.command.AbstractCommand;
27 import org.waarp.ftp.core.command.FtpCommandCode;
28
29
30
31
32 public class PBSZ extends AbstractCommand {
33
34 @Override
35 public final void exec() throws CommandAbstractException {
36 if (!getSession().isSslReady()) {
37
38 throw new Reply503Exception("Session not using SSL / TLS");
39 }
40
41 if (!hasArg()) {
42
43 throw new Reply501Exception("Missing Parameter: 0");
44 }
45 final String[] types = getArgs();
46 if (!"0".equalsIgnoreCase(types[0])) {
47
48 throw new Reply501Exception("Unknown Parameter: " + types[0]);
49 }
50 setExtraNextCommand(FtpCommandCode.PROT);
51 getSession().setReplyCode(ReplyCode.REPLY_200_COMMAND_OKAY, null);
52 }
53
54 }