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    *   http://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   * @since 3.3
22   */
23  public enum FTPCmd {
24  
25      /** FTP command. */
26      ABOR,
27  
28      /** FTP command. */
29      ACCT,
30  
31      /** FTP command. */
32      ALLO,
33  
34      /** FTP command. */
35      APPE,
36  
37      /** FTP command. */
38      CDUP,
39  
40      /** FTP command. */
41      CWD,
42  
43      /** FTP command. */
44      DELE,
45  
46      /** FTP command. */
47      EPRT,
48  
49      /** FTP command. */
50      EPSV,
51  
52      /** FTP command. */
53      FEAT,
54  
55      /** FTP command. */
56      HELP,
57  
58      /** FTP command. */
59      LIST,
60  
61      /** FTP command. */
62      MDTM,
63  
64      /** FTP command. */
65      MFMT,
66  
67      /** FTP command. */
68      MKD,
69  
70      /** FTP command. */
71      MLSD,
72  
73      /** FTP command. */
74      MLST,
75  
76      /** FTP command. */
77      MODE,
78  
79      /** FTP command. */
80      NLST,
81  
82      /** FTP command. */
83      NOOP,
84  
85      /** FTP command. */
86      PASS,
87  
88      /** FTP command. */
89      PASV,
90  
91      /** FTP command. */
92      PORT,
93  
94      /** FTP command. */
95      PWD,
96  
97      /** FTP command. */
98      QUIT,
99  
100     /** FTP command. */
101     REIN,
102 
103     /** FTP command. */
104     REST,
105 
106     /** FTP command. */
107     RETR,
108 
109     /** FTP command. */
110     RMD,
111 
112     /** FTP command. */
113     RNFR,
114 
115     /** FTP command. */
116     RNTO,
117 
118     /** FTP command. */
119     SITE,
120 
121     /** @since 3.7 */
122     SIZE,
123 
124     /** FTP command. */
125     SMNT,
126 
127     /** FTP command. */
128     STAT,
129 
130     /** FTP command. */
131     STOR,
132 
133     /** FTP command. */
134     STOU,
135 
136     /** FTP command. */
137     STRU,
138 
139     /** FTP command. */
140     SYST,
141 
142     /** FTP command. */
143     TYPE,
144 
145     /** FTP command. */
146     USER;
147 
148     // Aliases
149 
150     /** Alias. */
151     public static final FTPCmd ABORT = ABOR;
152 
153     /** Alias. */
154     public static final FTPCmd ACCOUNT = ACCT;
155 
156     /** Alias. */
157     public static final FTPCmd ALLOCATE = ALLO;
158 
159     /** Alias. */
160     public static final FTPCmd APPEND = APPE;
161 
162     /** Alias. */
163     public static final FTPCmd CHANGE_TO_PARENT_DIRECTORY = CDUP;
164 
165     /** Alias. */
166     public static final FTPCmd CHANGE_WORKING_DIRECTORY = CWD;
167 
168     /** Alias. */
169     public static final FTPCmd DATA_PORT = PORT;
170 
171     /** Alias. */
172     public static final FTPCmd DELETE = DELE;
173 
174     /** Alias. */
175     public static final FTPCmd FEATURES = FEAT;
176 
177     /** Alias. */
178     public static final FTPCmd FILE_STRUCTURE = STRU;
179 
180     /** Alias. */
181     public static final FTPCmd GET_MOD_TIME = MDTM;
182 
183     /** Alias. */
184     public static final FTPCmd LOGOUT = QUIT;
185 
186     /** Alias. */
187     public static final FTPCmd MAKE_DIRECTORY = MKD;
188 
189     /** Alias. */
190     public static final FTPCmd MOD_TIME = MDTM;
191 
192     /** Alias. */
193     public static final FTPCmd NAME_LIST = NLST;
194 
195     /** Alias. */
196     public static final FTPCmd PASSIVE = PASV;
197 
198     /** Alias. */
199     public static final FTPCmd PASSWORD = PASS;
200 
201     /** Alias. */
202     public static final FTPCmd PRINT_WORKING_DIRECTORY = PWD;
203 
204     /** Alias. */
205     public static final FTPCmd REINITIALIZE = REIN;
206 
207     /** Alias. */
208     public static final FTPCmd REMOVE_DIRECTORY = RMD;
209 
210     /** Alias. */
211     public static final FTPCmd RENAME_FROM = RNFR;
212 
213     /** Alias. */
214     public static final FTPCmd RENAME_TO = RNTO;
215 
216     /** Alias. */
217     public static final FTPCmd REPRESENTATION_TYPE = TYPE;
218 
219     /** Alias. */
220     public static final FTPCmd RESTART = REST;
221 
222     /** Alias. */
223     public static final FTPCmd RETRIEVE = RETR;
224 
225     /** Alias. */
226     public static final FTPCmd SET_MOD_TIME = MFMT;
227 
228     /** Alias. */
229     public static final FTPCmd SITE_PARAMETERS = SITE;
230 
231     /** Alias. */
232     public static final FTPCmd STATUS = STAT;
233 
234     /** Alias. */
235     public static final FTPCmd STORE = STOR;
236 
237     /** Alias. */
238     public static final FTPCmd STORE_UNIQUE = STOU;
239 
240     /** Alias. */
241     public static final FTPCmd STRUCTURE_MOUNT = SMNT;
242 
243     /** Alias. */
244     public static final FTPCmd SYSTEM = SYST;
245 
246     /** Alias. */
247     public static final FTPCmd TRANSFER_MODE = MODE;
248 
249     /** Alias. */
250     public static final FTPCmd USERNAME = USER;
251 
252     /**
253      * Retrieve the FTP protocol command string corresponding to a specified command code.
254      *
255      * @return The FTP protcol command string corresponding to a specified command code.
256      */
257     public final String getCommand() {
258         return this.name();
259     }
260 
261 }