Package org.eclipse.jgit.transport
Class HttpConfig
java.lang.Object
org.eclipse.jgit.transport.HttpConfig
A representation of the "http.*" config values in a git
Config. git provides for setting values for
specific URLs through "http.<url>.*" subsections. git always considers
only the initial original URL for such settings, not any redirected URL.- Since:
- 4.9
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumConfig values for http.followRedirect. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringCustom JGit config key which holds the maximum number of cookie files to keep in the cache.static final Stringgit config key for the "cookieFile" setting.private Stringprivate intprivate static final intprivate static final intprivate static final Stringstatic final Stringgit config key for the "extraHeader" setting.static final Stringgit config key for the "followRedirects" setting.private HttpConfig.HttpRedirectModeprivate static final Stringstatic final Stringgit config section key for http settings.private static final org.slf4j.Loggerprivate static final Stringprivate static final intstatic final Stringgit config key for the "maxRedirects" setting.private intstatic final Stringgit config key for the "postBuffer" setting.private intstatic final Stringgit config key for the "saveCookies" setting.private booleanstatic final Stringgit config key for the "sslVerify" setting.private booleanstatic final Stringgit config key for the "userAgent" setting.private String -
Constructor Summary
ConstructorsConstructorDescriptionHttpConfig(Config config, URIish uri) Creates a newHttpConfigtailored to the givenURIish.HttpConfig(URIish uri) Creates aHttpConfigthat reads values solely from the user config. -
Method Summary
Modifier and TypeMethodDescriptionprivate booleanprivate intdefaultedPort(int port, String scheme) private intfindLastEmpty(String[] values) private StringDetermines the best match from a set of subsection names (representing prefix URLs) for the givenURIish.Get the "http.cookieFile" settingintGet the "http.cookieFileCacheLimit" setting (gives the maximum number of cookie files to keep in the LRU cache)Get the "http.extraHeader" settingGet the "http.followRedirects" settingintGet the "http.maxRedirects" settingintGet the "http.postBuffer" settingbooleanGet the "http.saveCookies" settingGet the "http.userAgent" settingprivate voidbooleanGet the "http.sslVerify" setting(package private) static String(package private) static intsegmentCompare(String uriPath, String m)
-
Field Details
-
LOG
private static final org.slf4j.Logger LOG -
FTP
- See Also:
-
HTTP
git config section key for http settings.- See Also:
-
FOLLOW_REDIRECTS_KEY
git config key for the "followRedirects" setting.- See Also:
-
MAX_REDIRECTS_KEY
git config key for the "maxRedirects" setting.- See Also:
-
POST_BUFFER_KEY
git config key for the "postBuffer" setting.- See Also:
-
SSL_VERIFY_KEY
git config key for the "sslVerify" setting.- See Also:
-
USER_AGENT
git config key for the "userAgent" setting.- Since:
- 5.10
- See Also:
-
EXTRA_HEADER
git config key for the "extraHeader" setting.- Since:
- 5.10
- See Also:
-
COOKIE_FILE_KEY
git config key for the "cookieFile" setting.- Since:
- 5.4
- See Also:
-
SAVE_COOKIES_KEY
git config key for the "saveCookies" setting.- Since:
- 5.4
- See Also:
-
COOKIE_FILE_CACHE_LIMIT_KEY
Custom JGit config key which holds the maximum number of cookie files to keep in the cache.- Since:
- 5.4
- See Also:
-
DEFAULT_COOKIE_FILE_CACHE_LIMIT
private static final int DEFAULT_COOKIE_FILE_CACHE_LIMIT- See Also:
-
MAX_REDIRECT_SYSTEM_PROPERTY
- See Also:
-
DEFAULT_MAX_REDIRECTS
private static final int DEFAULT_MAX_REDIRECTS- See Also:
-
MAX_REDIRECTS
private static final int MAX_REDIRECTS -
ENV_HTTP_USER_AGENT
- See Also:
-
postBuffer
private int postBuffer -
sslVerify
private boolean sslVerify -
followRedirects
-
maxRedirects
private int maxRedirects -
userAgent
-
extraHeaders
-
cookieFile
-
saveCookies
private boolean saveCookies -
cookieFileCacheLimit
private int cookieFileCacheLimit
-
-
Constructor Details
-
HttpConfig
Creates a newHttpConfigtailored to the givenURIish.- Parameters:
config- to read theHttpConfigfromuri- to get the configuration values for
-
HttpConfig
Creates aHttpConfigthat reads values solely from the user config.- Parameters:
uri- to get the configuration values for
-
-
Method Details
-
getPostBuffer
public int getPostBuffer()Get the "http.postBuffer" setting- Returns:
- the value of the "http.postBuffer" setting
-
isSslVerify
public boolean isSslVerify()Get the "http.sslVerify" setting- Returns:
- the value of the "http.sslVerify" setting
-
getFollowRedirects
Get the "http.followRedirects" setting- Returns:
- the value of the "http.followRedirects" setting
-
getMaxRedirects
public int getMaxRedirects()Get the "http.maxRedirects" setting- Returns:
- the value of the "http.maxRedirects" setting
-
getUserAgent
Get the "http.userAgent" setting- Returns:
- the value of the "http.userAgent" setting
- Since:
- 5.10
-
getExtraHeaders
Get the "http.extraHeader" setting- Returns:
- the value of the "http.extraHeader" setting
- Since:
- 5.10
-
getCookieFile
Get the "http.cookieFile" setting- Returns:
- the value of the "http.cookieFile" setting
- Since:
- 5.4
-
getSaveCookies
public boolean getSaveCookies()Get the "http.saveCookies" setting- Returns:
- the value of the "http.saveCookies" setting
- Since:
- 5.4
-
getCookieFileCacheLimit
public int getCookieFileCacheLimit()Get the "http.cookieFileCacheLimit" setting (gives the maximum number of cookie files to keep in the LRU cache)- Returns:
- the value of the "http.cookieFileCacheLimit" setting
- Since:
- 5.4
-
init
-
findLastEmpty
-
findMatch
Determines the best match from a set of subsection names (representing prefix URLs) for the givenURIish.- Parameters:
names- to match against theuriuri- to find a match for- Returns:
- the best matching subsection name, or
nullif no subsection matches
-
compare
-
defaultedPort
-
segmentCompare
-
normalize
-