1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.apache.commons.net.ftp;
19
20
21
22
23
24
25
26
27 @Deprecated
28 public final class FTPCommand {
29
30
31 public static final int USER = 0;
32
33
34 public static final int PASS = 1;
35
36
37 public static final int ACCT = 2;
38
39
40 public static final int CWD = 3;
41
42
43 public static final int CDUP = 4;
44
45
46 public static final int SMNT = 5;
47
48
49 public static final int REIN = 6;
50
51
52 public static final int QUIT = 7;
53
54
55 public static final int PORT = 8;
56
57
58 public static final int PASV = 9;
59
60
61 public static final int TYPE = 10;
62
63
64 public static final int STRU = 11;
65
66
67 public static final int MODE = 12;
68
69
70 public static final int RETR = 13;
71
72
73 public static final int STOR = 14;
74
75
76
77
78 public static final int STOU = 15;
79
80
81 public static final int APPE = 16;
82
83
84
85
86 public static final int ALLO = 17;
87
88
89 public static final int REST = 18;
90
91
92 public static final int RNFR = 19;
93
94
95 public static final int RNTO = 20;
96
97
98 public static final int ABOR = 21;
99
100
101 public static final int DELE = 22;
102
103
104 public static final int RMD = 23;
105
106
107 public static final int MKD = 24;
108
109
110 public static final int PWD = 25;
111
112
113 public static final int LIST = 26;
114
115
116 public static final int NLST = 27;
117
118
119 public static final int SITE = 28;
120
121
122 public static final int SYST = 29;
123
124
125 public static final int STAT = 30;
126
127
128
129
130 public static final int HELP = 31;
131
132
133 public static final int NOOP = 32;
134
135
136
137
138
139
140 public static final int MDTM = 33;
141
142
143
144
145
146
147 public static final int FEAT = 34;
148
149
150
151
152
153
154 public static final int MFMT = 35;
155
156
157
158
159
160
161 public static final int EPSV = 36;
162
163
164
165
166
167
168 public static final int EPRT = 37;
169
170
171
172
173
174
175 public static final int MLSD = 38;
176
177
178
179
180
181
182 public static final int MLST = 39;
183
184
185 private static final int LAST = MLST;
186
187
188 public static final int USERNAME = USER;
189
190
191 public static final int PASSWORD = PASS;
192
193
194 public static final int ACCOUNT = ACCT;
195
196
197 public static final int CHANGE_WORKING_DIRECTORY = CWD;
198
199
200 public static final int CHANGE_TO_PARENT_DIRECTORY = CDUP;
201
202
203 public static final int STRUCTURE_MOUNT = SMNT;
204
205
206 public static final int REINITIALIZE = REIN;
207
208
209 public static final int LOGOUT = QUIT;
210
211
212 public static final int DATA_PORT = PORT;
213
214
215 public static final int PASSIVE = PASV;
216
217
218 public static final int REPRESENTATION_TYPE = TYPE;
219
220
221 public static final int FILE_STRUCTURE = STRU;
222
223
224 public static final int TRANSFER_MODE = MODE;
225
226
227 public static final int RETRIEVE = RETR;
228
229
230 public static final int STORE = STOR;
231
232
233 public static final int STORE_UNIQUE = STOU;
234
235
236 public static final int APPEND = APPE;
237
238
239 public static final int ALLOCATE = ALLO;
240
241
242 public static final int RESTART = REST;
243
244
245 public static final int RENAME_FROM = RNFR;
246
247
248 public static final int RENAME_TO = RNTO;
249
250
251 public static final int ABORT = ABOR;
252
253
254 public static final int DELETE = DELE;
255
256
257 public static final int REMOVE_DIRECTORY = RMD;
258
259
260 public static final int MAKE_DIRECTORY = MKD;
261
262
263 public static final int PRINT_WORKING_DIRECTORY = PWD;
264
265
266
267
268 public static final int NAME_LIST = NLST;
269
270
271 public static final int SITE_PARAMETERS = SITE;
272
273
274 public static final int SYSTEM = SYST;
275
276
277 public static final int STATUS = STAT;
278
279
280
281
282
283
284
285
286 public static final int MOD_TIME = MDTM;
287
288
289
290
291
292 public static final int FEATURES = FEAT;
293
294
295
296
297
298 public static final int GET_MOD_TIME = MDTM;
299
300
301
302
303
304 public static final int SET_MOD_TIME = MFMT;
305
306 private static final String[] COMMANDS = { "USER", "PASS", "ACCT", "CWD", "CDUP", "SMNT", "REIN", "QUIT", "PORT", "PASV", "TYPE", "STRU", "MODE", "RETR",
307 "STOR", "STOU", "APPE", "ALLO", "REST", "RNFR", "RNTO", "ABOR", "DELE", "RMD", "MKD", "PWD", "LIST", "NLST", "SITE", "SYST", "STAT", "HELP", "NOOP",
308 "MDTM", "FEAT", "MFMT", "EPSV", "EPRT", "MLSD", "MLST" };
309
310
311
312
313 static void checkArray() {
314 final int expectedLength = LAST + 1;
315 if (COMMANDS.length != expectedLength) {
316 throw new IllegalStateException("Incorrect COMMANDS array. Should have length " + expectedLength + " found " + COMMANDS.length);
317 }
318 }
319
320
321
322
323
324
325
326 public static String getCommand(final int command) {
327 return COMMANDS[command];
328 }
329
330
331 private FTPCommand() {
332 }
333 }