001/* 002 * Licensed to the Apache Software Foundation (ASF) under one or more 003 * contributor license agreements. See the NOTICE file distributed with 004 * this work for additional information regarding copyright ownership. 005 * The ASF licenses this file to You under the Apache License, Version 2.0 006 * (the "License"); you may not use this file except in compliance with 007 * the License. You may obtain a copy of the License at 008 * 009 * https://www.apache.org/licenses/LICENSE-2.0 010 * 011 * Unless required by applicable law or agreed to in writing, software 012 * distributed under the License is distributed on an "AS IS" BASIS, 013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 014 * See the License for the specific language governing permissions and 015 * limitations under the License. 016 */ 017 018package org.apache.commons.net.ftp; 019 020/** 021 * Enumerates FTP commands. 022 * 023 * @since 3.3 024 */ 025public enum FTPCmd { 026 027 /** FTP command ABOR. */ 028 ABOR, 029 030 /** FTP command ACCT. */ 031 ACCT, 032 033 /** FTP command ALLO. */ 034 ALLO, 035 036 /** FTP command APPE. */ 037 APPE, 038 039 /** FTP command CDUP. */ 040 CDUP, 041 042 /** FTP command CWD. */ 043 CWD, 044 045 /** FTP command DELE. */ 046 DELE, 047 048 /** FTP command EPRT. */ 049 EPRT, 050 051 /** FTP command EPSV. */ 052 EPSV, 053 054 /** FTP command <a href="https://datatracker.ietf.org/doc/html/rfc2389#section-3">FEAT</a>. */ 055 FEAT, 056 057 /** FTP command HELP. */ 058 HELP, 059 060 /** FTP command LIST. */ 061 LIST, 062 063 /** FTP command MDTM. */ 064 MDTM, 065 066 /** FTP command MFMT. */ 067 MFMT, 068 069 /** FTP command MKD. */ 070 MKD, 071 072 /** FTP command MLSD. */ 073 MLSD, 074 075 /** FTP command MLST. */ 076 MLST, 077 078 /** FTP command MODE. */ 079 MODE, 080 081 /** FTP command NLST. */ 082 NLST, 083 084 /** FTP command NOOP. */ 085 NOOP, 086 087 /** 088 * FTP command <a href="https://datatracker.ietf.org/doc/html/rfc2389#section-4">OPTS</a>. 089 * 090 * @since 3.12.0 091 */ 092 OPTS, 093 094 /** FTP command PASS. */ 095 PASS, 096 097 /** FTP command PASV. */ 098 PASV, 099 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}