Package org.eclipse.jgit.transport
Class HttpConfig
- java.lang.Object
-
- org.eclipse.jgit.transport.HttpConfig
-
public class HttpConfig extends java.lang.ObjectA representation of the "http.*" config values in a gitConfig. 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 Classes Modifier and Type Class Description static classHttpConfig.HttpRedirectModeConfig values for http.followRedirect.
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCOOKIE_FILE_CACHE_LIMIT_KEYCustom JGit config key which holds the maximum number of cookie files to keep in the cache.static java.lang.StringCOOKIE_FILE_KEYgit config key for the "cookieFile" setting.private java.lang.StringcookieFileprivate intcookieFileCacheLimitprivate static intDEFAULT_COOKIE_FILE_CACHE_LIMITprivate static intDEFAULT_MAX_REDIRECTSstatic java.lang.StringFOLLOW_REDIRECTS_KEYgit config key for the "followRedirects" setting.private HttpConfig.HttpRedirectModefollowRedirectsprivate static java.lang.StringFTPstatic java.lang.StringHTTPgit config section key for http settings.private static org.slf4j.LoggerLOGprivate static java.lang.StringMAX_REDIRECT_SYSTEM_PROPERTYprivate static intMAX_REDIRECTSstatic java.lang.StringMAX_REDIRECTS_KEYgit config key for the "maxRedirects" setting.private intmaxRedirectsstatic java.lang.StringPOST_BUFFER_KEYgit config key for the "postBuffer" setting.private intpostBufferstatic java.lang.StringSAVE_COOKIES_KEYgit config key for the "saveCookies" setting.private booleansaveCookiesstatic java.lang.StringSSL_VERIFY_KEYgit config key for the "sslVerify" setting.private booleansslVerify
-
Constructor Summary
Constructors Constructor Description HttpConfig(Config config, URIish uri)Creates a newHttpConfigtailored to the givenURIish.HttpConfig(URIish uri)Creates aHttpConfigthat reads values solely from the user config.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private booleancompare(java.lang.String a, java.lang.String b)private intdefaultedPort(int port, java.lang.String scheme)private java.lang.StringfindMatch(java.util.Set<java.lang.String> names, URIish uri)Determines the best match from a set of subsection names (representing prefix URLs) for the givenURIish.java.lang.StringgetCookieFile()Get the "http.cookieFile" settingintgetCookieFileCacheLimit()Get the "http.cookieFileCacheLimit" setting (gives the maximum number of cookie files to keep in the LRU cache)HttpConfig.HttpRedirectModegetFollowRedirects()Get the "http.followRedirects" settingintgetMaxRedirects()Get the "http.maxRedirects" settingintgetPostBuffer()Get the "http.postBuffer" settingbooleangetSaveCookies()Get the "http.saveCookies" settingprivate voidinit(Config config, URIish uri)booleanisSslVerify()Get the "http.sslVerify" setting(package private) static java.lang.Stringnormalize(java.lang.String path)(package private) static intsegmentCompare(java.lang.String uriPath, java.lang.String m)
-
-
-
Field Detail
-
LOG
private static final org.slf4j.Logger LOG
-
FTP
private static final java.lang.String FTP
- See Also:
- Constant Field Values
-
HTTP
public static final java.lang.String HTTP
git config section key for http settings.- See Also:
- Constant Field Values
-
FOLLOW_REDIRECTS_KEY
public static final java.lang.String FOLLOW_REDIRECTS_KEY
git config key for the "followRedirects" setting.- See Also:
- Constant Field Values
-
MAX_REDIRECTS_KEY
public static final java.lang.String MAX_REDIRECTS_KEY
git config key for the "maxRedirects" setting.- See Also:
- Constant Field Values
-
POST_BUFFER_KEY
public static final java.lang.String POST_BUFFER_KEY
git config key for the "postBuffer" setting.- See Also:
- Constant Field Values
-
SSL_VERIFY_KEY
public static final java.lang.String SSL_VERIFY_KEY
git config key for the "sslVerify" setting.- See Also:
- Constant Field Values
-
COOKIE_FILE_KEY
public static final java.lang.String COOKIE_FILE_KEY
git config key for the "cookieFile" setting.- Since:
- 5.4
- See Also:
- Constant Field Values
-
SAVE_COOKIES_KEY
public static final java.lang.String SAVE_COOKIES_KEY
git config key for the "saveCookies" setting.- Since:
- 5.4
- See Also:
- Constant Field Values
-
COOKIE_FILE_CACHE_LIMIT_KEY
public static final java.lang.String 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:
- Constant Field Values
-
DEFAULT_COOKIE_FILE_CACHE_LIMIT
private static final int DEFAULT_COOKIE_FILE_CACHE_LIMIT
- See Also:
- Constant Field Values
-
MAX_REDIRECT_SYSTEM_PROPERTY
private static final java.lang.String MAX_REDIRECT_SYSTEM_PROPERTY
- See Also:
- Constant Field Values
-
DEFAULT_MAX_REDIRECTS
private static final int DEFAULT_MAX_REDIRECTS
- See Also:
- Constant Field Values
-
MAX_REDIRECTS
private static final int MAX_REDIRECTS
-
postBuffer
private int postBuffer
-
sslVerify
private boolean sslVerify
-
followRedirects
private HttpConfig.HttpRedirectMode followRedirects
-
maxRedirects
private int maxRedirects
-
cookieFile
private java.lang.String cookieFile
-
saveCookies
private boolean saveCookies
-
cookieFileCacheLimit
private int cookieFileCacheLimit
-
-
Constructor Detail
-
HttpConfig
public HttpConfig(Config config, URIish uri)
Creates a newHttpConfigtailored to the givenURIish.- Parameters:
config- to read theHttpConfigfromuri- to get the configuration values for
-
HttpConfig
public HttpConfig(URIish uri)
Creates aHttpConfigthat reads values solely from the user config.- Parameters:
uri- to get the configuration values for
-
-
Method Detail
-
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
public HttpConfig.HttpRedirectMode 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
-
getCookieFile
public java.lang.String 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
-
findMatch
private java.lang.String findMatch(java.util.Set<java.lang.String> names, URIish uri)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
private boolean compare(java.lang.String a, java.lang.String b)
-
defaultedPort
private int defaultedPort(int port, java.lang.String scheme)
-
segmentCompare
static int segmentCompare(java.lang.String uriPath, java.lang.String m)
-
normalize
static java.lang.String normalize(java.lang.String path)
-
-