Top Description Fields Constructors Methods
org.eclipse.jgit.internal.transport.parser

public final Class FirstCommand

extends Object
Class Inheritance
Imports
java.util.Collections, .HashMap, .Map, org.eclipse.jgit.annotations.NonNull

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.

Field Summary

Modifier and TypeField and Description
private final Map<String, String>
private final String

Constructor Summary

AccessConstructor and Description
private
FirstCommand(String line, Map<String, String> capabilities)

Method Summary

Modifier and TypeMethod and Description
public static FirstCommand

Returns:

an instance of FirstCommand with capabilities parsed out
fromLine
(String
line from the client.
line
)

Parse the first line of a receive-pack request.

public Map<String, String>

Returns:

capabilities parsed from the line, as an immutable map.
getCapabilities
()

Get capabilities

public String

Returns:

non-capabilities part of the line.
getLine
()

Get line

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

capabilitiesback to summary
private final Map<String, String> capabilities
lineback to summary
private final String line

Constructor Detail

FirstCommandback to summary
private FirstCommand(String line, Map<String, String> capabilities)

Method Detail

fromLineback to summary
public static FirstCommand fromLine(String line)

Parse the first line of a receive-pack request.

Parameters
line:String

line from the client.

Returns:FirstCommand

an instance of FirstCommand with capabilities parsed out

Annotations
@NonNull
getCapabilitiesback to summary
public Map<String, String> getCapabilities()

Get capabilities

Returns:Map<String, String>

capabilities parsed from the line, as an immutable map.

Annotations
@NonNull
getLineback to summary
public String getLine()

Get line

Returns:String

non-capabilities part of the line.

Annotations
@NonNull