Class HttpParser
- java.lang.Object
-
- org.eclipse.jgit.internal.transport.sshd.proxy.HttpParser
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classHttpParser.ParseExceptionAn exception indicating some problem parsing HTPP headers.
-
Constructor Summary
Constructors Modifier Constructor Description privateHttpParser()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.List<AuthenticationChallenge>getAuthenticationHeaders(java.util.List<java.lang.String> reply, java.lang.String authenticationHeader)Extract the authentication headers from the header lines.private static intparseChallenge(AuthenticationChallenge challenge, java.lang.String header, int from)private static voidparseChallenges(java.util.List<AuthenticationChallenge> challenges, java.lang.String header)static StatusLineparseStatusLine(java.lang.String line)Parse a HTTP response status line.private static java.lang.StringscanQuotedString(java.lang.String header, int from, int[] to)private static intskipWhiteSpace(java.lang.String header, int i)
-
-
-
Method Detail
-
parseStatusLine
public static StatusLine parseStatusLine(java.lang.String line) throws HttpParser.ParseException
Parse a HTTP response status line.- Parameters:
line- to parse- Returns:
- the
StatusLine - Throws:
HttpParser.ParseException- if the line cannot be parsed or has the wrong HTTP version
-
getAuthenticationHeaders
public static java.util.List<AuthenticationChallenge> getAuthenticationHeaders(java.util.List<java.lang.String> reply, java.lang.String authenticationHeader)
Extract the authentication headers from the header lines. It is assumed that the first element inreplyis the raw status line as received from the server. It is skipped. Line processing stops on the first empty line thereafter.- Parameters:
reply- The complete (header) lines of the HTTP responseauthenticationHeader- to look for (including the terminating ':'!)- Returns:
- a list of
AuthenticationChallenges found.
-
parseChallenges
private static void parseChallenges(java.util.List<AuthenticationChallenge> challenges, java.lang.String header)
-
parseChallenge
private static int parseChallenge(AuthenticationChallenge challenge, java.lang.String header, int from)
-
skipWhiteSpace
private static int skipWhiteSpace(java.lang.String header, int i)
-
scanQuotedString
private static java.lang.String scanQuotedString(java.lang.String header, int from, int[] to)
-
-