Class FirstCommand

  • public final class FirstCommand
    extends Object
    In a push, the client sends a list of commands. The first command is special, as it can include a list of capabilities at its end.

    For example: "oid oid name\0cap1 cap cap3"

    Not to be confused with FirstWant, nor with the first line of the reference advertisement parsed by BasePackConnection.readAdvertisedRefs.

    This class parses the inputted command line and holds the results: the actual command line and the capabilities.

    • Method Detail

      • fromLine

        public static FirstCommand fromLine​(String line)
        Parse the first line of a receive-pack request.
        line - line from the client.
        an instance of FirstCommand with capabilities parsed out
      • getLine

        public String getLine()
        non-capabilities part of the line.
      • getCapabilities

        public Set<String> getCapabilities()
        capabilities parsed from the line, as an immutable set.