Package org.eclipse.jgit.transport
Class ProtocolV2Parser
java.lang.Object
org.eclipse.jgit.transport.ProtocolV2Parser
Parse the incoming git protocol lines from the wire and translate them into a
Request object.
It requires a transferConfig object to know what the server supports (e.g.
ref-in-want and/or filters).
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static String
consumeCapabilities
(PacketLineIn pckIn, Consumer<String> serverOptionConsumer, Consumer<String> agentConsumer) (package private) FetchV2Request
parseFetchRequest
(PacketLineIn pckIn) Parse the incoming fetch request arguments from the wire.(package private) LsRefsV2Request
parseLsRefsRequest
(PacketLineIn pckIn) Parse the incoming ls-refs request arguments from the wire.
-
Field Details
-
transferConfig
-
-
Constructor Details
-
ProtocolV2Parser
ProtocolV2Parser(TransferConfig transferConfig)
-
-
Method Details
-
consumeCapabilities
private static String consumeCapabilities(PacketLineIn pckIn, Consumer<String> serverOptionConsumer, Consumer<String> agentConsumer) throws IOException - Throws:
IOException
-
parseFetchRequest
Parse the incoming fetch request arguments from the wire. The caller must be sure that what is comings is a fetch request before coming here.- Parameters:
pckIn
- incoming lines- Returns:
- A FetchV2Request populated with information received from the wire.
- Throws:
PackProtocolException
- incompatible options, wrong type of arguments or other issues where the request breaks the protocol.IOException
- an IO error prevented reading the incoming message.
-
parseLsRefsRequest
Parse the incoming ls-refs request arguments from the wire. This is meant for calling immediately after the caller has consumed a "command=ls-refs" line indicating the beginning of a ls-refs request. The incoming PacketLineIn is consumed until an END line, but the caller is responsible for closing it (if needed)- Parameters:
pckIn
- incoming lines. This method will read until an END line.- Returns:
- a LsRefsV2Request object with the data received in the wire.
- Throws:
PackProtocolException
- for inconsistencies in the protocol (e.g. unexpected lines)IOException
- reporting problems reading the incoming messages from the wire
-