Class Command


  • public class Command
    extends java.lang.Object
    Represents an FTP Control Channel Command
    • Field Detail

      • FEAT

        public static final Command FEAT
      • ABOR

        public static final Command ABOR
      • CDUP

        public static final Command CDUP
      • PWD

        public static final Command PWD
      • QUIT

        public static final Command QUIT
      • PASV

        public static final Command PASV
      • SPAS

        public static final Command SPAS
      • EPSV

        public static final Command EPSV
      • name

        private java.lang.String name
      • parameters

        private java.lang.String parameters
    • Constructor Detail

      • Command

        public Command​(java.lang.String name,
                       java.lang.String parameters)
                throws java.lang.IllegalArgumentException
        Parameters:
        name - the command name, eg. "PUT"
        parameters - the command parameters; in other words everything that is contained between the space after the command name and the trailing Telnet EOL, excluding both the mentioned space and EOL. For instance, in command "STOR /tmp/file.txt\r\n", the parameters would be: "/tmp/file.txt" and trailing EOL.
        Throws:
        java.lang.IllegalArgumentException
      • Command

        public Command​(java.lang.String name)
                throws java.lang.IllegalArgumentException
        Throws:
        java.lang.IllegalArgumentException
    • Method Detail

      • initialize

        private void initialize​(java.lang.String name,
                                java.lang.String parameters)
                         throws java.lang.IllegalArgumentException
        Throws:
        java.lang.IllegalArgumentException
      • toString

        public static java.lang.String toString​(Command command)
        Returns:
        a String representation of this object, that is <name> <sp> <parameters> <CRLF>
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object