Class SshCommandFactory.CommandLine

  • All Implemented Interfaces:
    Iterable<String>, Collection<String>, List<String>
    Enclosing class:

    public static final class SshCommandFactory.CommandLine
    extends AbstractList<String>
    Represents a command line.

    Unlike the rest of Unix, SSH protocol uses a single string (as opposed to string array) to pass around a whole command line between the client and the server, and it's up to the server to interpret that string as an array.

    This class encapsulates this single-line command arguments and provide both tokenized versions (for typical use) and the direct access to that string (for unusual case), thereby ensuring the consistency across tokenization.

    This class implements tokenization that correctly handles escaping by quotes.