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 *   http://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 */
018
019package org.apache.commons.net.ftp;
020
021/**
022 * @since 3.3
023 */
024public enum FTPCmd {
025    ABOR, ACCT, ALLO, APPE, CDUP, CWD, DELE, EPRT, EPSV, FEAT, HELP, LIST, MDTM, MFMT, MKD, MLSD, MLST, MODE, NLST, NOOP, PASS, PASV, PORT, PWD, QUIT, REIN,
026    REST, RETR, RMD, RNFR, RNTO, SITE,
027    /** @since 3.7 */
028    SIZE, SMNT, STAT, STOR, STOU, STRU, SYST, TYPE, USER,;
029
030    // Aliases
031
032    public static final FTPCmd ABORT = ABOR;
033    public static final FTPCmd ACCOUNT = ACCT;
034    public static final FTPCmd ALLOCATE = ALLO;
035    public static final FTPCmd APPEND = APPE;
036    public static final FTPCmd CHANGE_TO_PARENT_DIRECTORY = CDUP;
037    public static final FTPCmd CHANGE_WORKING_DIRECTORY = CWD;
038    public static final FTPCmd DATA_PORT = PORT;
039    public static final FTPCmd DELETE = DELE;
040    public static final FTPCmd FEATURES = FEAT;
041    public static final FTPCmd FILE_STRUCTURE = STRU;
042    public static final FTPCmd GET_MOD_TIME = MDTM;
043    public static final FTPCmd LOGOUT = QUIT;
044    public static final FTPCmd MAKE_DIRECTORY = MKD;
045    public static final FTPCmd MOD_TIME = MDTM;
046    public static final FTPCmd NAME_LIST = NLST;
047    public static final FTPCmd PASSIVE = PASV;
048    public static final FTPCmd PASSWORD = PASS;
049    public static final FTPCmd PRINT_WORKING_DIRECTORY = PWD;
050    public static final FTPCmd REINITIALIZE = REIN;
051    public static final FTPCmd REMOVE_DIRECTORY = RMD;
052    public static final FTPCmd RENAME_FROM = RNFR;
053    public static final FTPCmd RENAME_TO = RNTO;
054    public static final FTPCmd REPRESENTATION_TYPE = TYPE;
055    public static final FTPCmd RESTART = REST;
056    public static final FTPCmd RETRIEVE = RETR;
057    public static final FTPCmd SET_MOD_TIME = MFMT;
058    public static final FTPCmd SITE_PARAMETERS = SITE;
059    public static final FTPCmd STATUS = STAT;
060    public static final FTPCmd STORE = STOR;
061    public static final FTPCmd STORE_UNIQUE = STOU;
062    public static final FTPCmd STRUCTURE_MOUNT = SMNT;
063    public static final FTPCmd SYSTEM = SYST;
064    public static final FTPCmd TRANSFER_MODE = MODE;
065    public static final FTPCmd USERNAME = USER;
066
067    /**
068     * Retrieve the FTP protocol command string corresponding to a specified command code.
069     *
070     * @return The FTP protcol command string corresponding to a specified command code.
071     */
072    public final String getCommand() {
073        return this.name();
074    }
075
076}