Class FirstCommand
- java.lang.Object
-
- org.eclipse.jgit.internal.transport.parser.FirstCommand
-
public final class FirstCommand extends java.lang.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 byBasePackConnection.readAdvertisedRefs
.This class parses the inputted command line and holds the results: the actual command line and the capabilities.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Set<java.lang.String>
capabilities
private java.lang.String
line
-
Constructor Summary
Constructors Modifier Constructor Description private
FirstCommand(java.lang.String line, java.util.Set<java.lang.String> capabilities)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static FirstCommand
fromLine(java.lang.String line)
Parse the first line of a receive-pack request.java.util.Set<java.lang.String>
getCapabilities()
java.lang.String
getLine()
-
-
-
Method Detail
-
fromLine
@NonNull public static FirstCommand fromLine(java.lang.String line)
Parse the first line of a receive-pack request.- Parameters:
line
- line from the client.- Returns:
- an instance of FirstCommand with capabilities parsed out
-
getLine
@NonNull public java.lang.String getLine()
- Returns:
- non-capabilities part of the line.
-
getCapabilities
@NonNull public java.util.Set<java.lang.String> getCapabilities()
- Returns:
- capabilities parsed from the line, as an immutable set.
-
-