Top Description Constructors Methods
org.eclipse.jgit.http.server

public Class ClientVersionUtil

extends Object
Class Inheritance
Imports
jakarta.servlet.http.HttpServletRequest

Parses Git client User-Agent strings.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static int

Returns:

< 0 if a is before b; 0 if a equals b; >0 if a is after b.
compare
(int[]
first parsed version string.
a
,
int[]
second parsed version string.
b
)

Compare two version strings for natural ordering.

private static int[]
grow(int[] tmp)

public static boolean

Returns:

true if the client has the chunked encoding bug.
hasChunkedEncodingRequestBug
(int[]
parsed version of the Git client software.
version
,
HttpServletRequest
incoming HTTP request.
request
)
Deprecated no widely used Git versions need this any more

Check if a Git client has the known chunked request body encoding bug.

public static boolean

Returns:

true if the bug is present.
hasPushStatusBug
(int[]
parsed version of the Git client software.
version
)
Deprecated no widely used Git versions need this any more

Check if a Git client has the known push status bug.

public static int[]

Returns:

maximum version array, indicating an invalid version of Git.
invalidVersion
()

An invalid version of Git

public static int[]

Returns:

components of the version string. invalidVersion() if the version string cannot be parsed.
parseVersion
(String
git client version string, of the form "git/1.7.9".
version
)

Parse a Git client User-Agent header value.

private static int[]
splitVersion(String versionString)

public static String

Returns:

a string, e.g. "1.6.6.0".
toString
(int[]
the parsed version array.
ver
)

Convert a parsed version back to a string.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

ClientVersionUtilback to summary
private ClientVersionUtil()

Method Detail

compareback to summary
public static int compare(int[] a, int[] b)

Compare two version strings for natural ordering.

Parameters
a:int[]

first parsed version string.

b:int[]

second parsed version string.

Returns:int

< 0 if a is before b; 0 if a equals b; >0 if a is after b.

growback to summary
private static int[] grow(int[] tmp)
hasChunkedEncodingRequestBugback to summary
public static boolean hasChunkedEncodingRequestBug(int[] version, HttpServletRequest request)

Deprecated

no widely used Git versions need this any more

Check if a Git client has the known chunked request body encoding bug.

Git 1.7.5 contains a unique bug where chunked requests are malformed. This applies to both fetch and push.

Parameters
version:int[]

parsed version of the Git client software.

request:HttpServletRequest

incoming HTTP request.

Returns:boolean

true if the client has the chunked encoding bug.

Annotations
@Deprecated
Since
7.0
hasPushStatusBugback to summary
public static boolean hasPushStatusBug(int[] version)

Deprecated

no widely used Git versions need this any more

Check if a Git client has the known push status bug.

These buggy clients do not display the status report from a failed push over HTTP.

Parameters
version:int[]

parsed version of the Git client software.

Returns:boolean

true if the bug is present.

Annotations
@Deprecated
invalidVersionback to summary
public static int[] invalidVersion()

An invalid version of Git

Returns:int[]

maximum version array, indicating an invalid version of Git.

parseVersionback to summary
public static int[] parseVersion(String version)

Parse a Git client User-Agent header value.

Parameters
version:String

git client version string, of the form "git/1.7.9".

Returns:int[]

components of the version string. invalidVersion() if the version string cannot be parsed.

splitVersionback to summary
private static int[] splitVersion(String versionString)
toStringback to summary
public static String toString(int[] ver)

Convert a parsed version back to a string.

Parameters
ver:int[]

the parsed version array.

Returns:String

a string, e.g. "1.6.6.0".