View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * The ASF licenses this file to You under the Apache License, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License.  You may obtain a copy of the License at
8    *
9    *   https://www.apache.org/licenses/LICENSE-2.0
10   *
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
16   */
17  
18  package org.apache.commons.net.ftp;
19  
20  /**
21   * Enumerates FTP commands.
22   *
23   * @since 3.3
24   */
25  public enum FTPCmd {
26  
27      /** FTP command ABOR. */
28      ABOR,
29  
30      /** FTP command ACCT. */
31      ACCT,
32  
33      /** FTP command ALLO. */
34      ALLO,
35  
36      /** FTP command APPE. */
37      APPE,
38  
39      /** FTP command CDUP. */
40      CDUP,
41  
42      /** FTP command CWD. */
43      CWD,
44  
45      /** FTP command DELE. */
46      DELE,
47  
48      /** FTP command EPRT. */
49      EPRT,
50  
51      /** FTP command EPSV. */
52      EPSV,
53  
54      /** FTP command <a href="https://datatracker.ietf.org/doc/html/rfc2389#section-3">FEAT</a>. */
55      FEAT,
56  
57      /** FTP command HELP. */
58      HELP,
59  
60      /** FTP command LIST. */
61      LIST,
62  
63      /** FTP command MDTM. */
64      MDTM,
65  
66      /** FTP command MFMT. */
67      MFMT,
68  
69      /** FTP command MKD. */
70      MKD,
71  
72      /** FTP command MLSD. */
73      MLSD,
74  
75      /** FTP command MLST. */
76      MLST,
77  
78      /** FTP command MODE. */
79      MODE,
80  
81      /** FTP command NLST. */
82      NLST,
83  
84      /** FTP command NOOP. */
85      NOOP,
86  
87      /**
88       * FTP command <a href="https://datatracker.ietf.org/doc/html/rfc2389#section-4">OPTS</a>.
89       *
90       * @since 3.12.0
91       */
92      OPTS,
93  
94      /** FTP command PASS. */
95      PASS,
96  
97      /** FTP command PASV. */
98      PASV,
99  
100     /** FTP command PORT. */
101     PORT,
102 
103     /** FTP command PWD. */
104     PWD,
105 
106     /** FTP command QUIT. */
107     QUIT,
108 
109     /** FTP command REIN. */
110     REIN,
111 
112     /** FTP command REST. */
113     REST,
114 
115     /** FTP command RETR. */
116     RETR,
117 
118     /** FTP command RMD. */
119     RMD,
120 
121     /** FTP command RNFR. */
122     RNFR,
123 
124     /** FTP command RNTO. */
125     RNTO,
126 
127     /** FTP command SITE. */
128     SITE,
129 
130     /**
131      * FTP command SIZE.
132      *
133      * @since 3.7
134      */
135     SIZE,
136 
137     /** FTP command SMNT. */
138     SMNT,
139 
140     /** FTP command STAT. */
141     STAT,
142 
143     /** FTP command STOR. */
144     STOR,
145 
146     /** FTP command STOU. */
147     STOU,
148 
149     /** FTP command STRU. */
150     STRU,
151 
152     /** FTP command SYST. */
153     SYST,
154 
155     /** FTP command TYPE. */
156     TYPE,
157 
158     /** FTP command USER. */
159     USER;
160 
161     // Aliases
162 
163     /** Alias. */
164     public static final FTPCmd ABORT = ABOR;
165 
166     /** Alias. */
167     public static final FTPCmd ACCOUNT = ACCT;
168 
169     /** Alias. */
170     public static final FTPCmd ALLOCATE = ALLO;
171 
172     /** Alias. */
173     public static final FTPCmd APPEND = APPE;
174 
175     /** Alias. */
176     public static final FTPCmd CHANGE_TO_PARENT_DIRECTORY = CDUP;
177 
178     /** Alias. */
179     public static final FTPCmd CHANGE_WORKING_DIRECTORY = CWD;
180 
181     /** Alias. */
182     public static final FTPCmd DATA_PORT = PORT;
183 
184     /** Alias. */
185     public static final FTPCmd DELETE = DELE;
186 
187     /** Alias. */
188     public static final FTPCmd FEATURES = FEAT;
189 
190     /** Alias. */
191     public static final FTPCmd FILE_STRUCTURE = STRU;
192 
193     /** Alias. */
194     public static final FTPCmd GET_MOD_TIME = MDTM;
195 
196     /** Alias. */
197     public static final FTPCmd LOGOUT = QUIT;
198 
199     /** Alias. */
200     public static final FTPCmd MAKE_DIRECTORY = MKD;
201 
202     /** Alias. */
203     public static final FTPCmd MOD_TIME = MDTM;
204 
205     /** Alias. */
206     public static final FTPCmd NAME_LIST = NLST;
207 
208     /** Alias. */
209     public static final FTPCmd PASSIVE = PASV;
210 
211     /** Alias. */
212     public static final FTPCmd PASSWORD = PASS;
213 
214     /** Alias. */
215     public static final FTPCmd PRINT_WORKING_DIRECTORY = PWD;
216 
217     /** Alias. */
218     public static final FTPCmd REINITIALIZE = REIN;
219 
220     /** Alias. */
221     public static final FTPCmd REMOVE_DIRECTORY = RMD;
222 
223     /** Alias. */
224     public static final FTPCmd RENAME_FROM = RNFR;
225 
226     /** Alias. */
227     public static final FTPCmd RENAME_TO = RNTO;
228 
229     /** Alias. */
230     public static final FTPCmd REPRESENTATION_TYPE = TYPE;
231 
232     /** Alias. */
233     public static final FTPCmd RESTART = REST;
234 
235     /** Alias. */
236     public static final FTPCmd RETRIEVE = RETR;
237 
238     /** Alias. */
239     public static final FTPCmd SET_MOD_TIME = MFMT;
240 
241     /** Alias. */
242     public static final FTPCmd SITE_PARAMETERS = SITE;
243 
244     /** Alias. */
245     public static final FTPCmd STATUS = STAT;
246 
247     /** Alias. */
248     public static final FTPCmd STORE = STOR;
249 
250     /** Alias. */
251     public static final FTPCmd STORE_UNIQUE = STOU;
252 
253     /** Alias. */
254     public static final FTPCmd STRUCTURE_MOUNT = SMNT;
255 
256     /** Alias. */
257     public static final FTPCmd SYSTEM = SYST;
258 
259     /** Alias. */
260     public static final FTPCmd TRANSFER_MODE = MODE;
261 
262     /** Alias. */
263     public static final FTPCmd USERNAME = USER;
264 
265     /**
266      * Retrieve the FTP protocol command string corresponding to a specified command code.
267      *
268      * @return The FTP protcol command string corresponding to a specified command code.
269      */
270     public String getCommand() {
271         return name();
272     }
273 
274 }