public class HttpConfig
extends java.lang.Object
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.Modifier and Type | Class and Description |
---|---|
static class |
HttpConfig.HttpRedirectMode
Config values for http.followRedirect.
|
Modifier and Type | Field and Description |
---|---|
static 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.
|
static java.lang.String |
COOKIE_FILE_KEY
git config key for the "cookieFile" setting.
|
private java.lang.String |
cookieFile |
private int |
cookieFileCacheLimit |
private static int |
DEFAULT_COOKIE_FILE_CACHE_LIMIT |
private static int |
DEFAULT_MAX_REDIRECTS |
static java.lang.String |
FOLLOW_REDIRECTS_KEY
git config key for the "followRedirects" setting.
|
private HttpConfig.HttpRedirectMode |
followRedirects |
private static java.lang.String |
FTP |
static java.lang.String |
HTTP
git config section key for http settings.
|
private static org.slf4j.Logger |
LOG |
private static java.lang.String |
MAX_REDIRECT_SYSTEM_PROPERTY |
private static int |
MAX_REDIRECTS |
static java.lang.String |
MAX_REDIRECTS_KEY
git config key for the "maxRedirects" setting.
|
private int |
maxRedirects |
static java.lang.String |
POST_BUFFER_KEY
git config key for the "postBuffer" setting.
|
private int |
postBuffer |
static java.lang.String |
SAVE_COOKIES_KEY
git config key for the "saveCookies" setting.
|
private boolean |
saveCookies |
static java.lang.String |
SSL_VERIFY_KEY
git config key for the "sslVerify" setting.
|
private boolean |
sslVerify |
Constructor and Description |
---|
HttpConfig(Config config,
URIish uri)
Creates a new
HttpConfig tailored to
the given URIish . |
HttpConfig(URIish uri)
Creates a
HttpConfig that reads values
solely from the user config. |
Modifier and Type | Method and Description |
---|---|
private boolean |
compare(java.lang.String a,
java.lang.String b) |
private int |
defaultedPort(int port,
java.lang.String scheme) |
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 given
URIish . |
java.lang.String |
getCookieFile()
Get the "http.cookieFile" setting
|
int |
getCookieFileCacheLimit()
Get the "http.cookieFileCacheLimit" setting (gives the maximum number of
cookie files to keep in the LRU cache)
|
HttpConfig.HttpRedirectMode |
getFollowRedirects()
Get the "http.followRedirects" setting
|
int |
getMaxRedirects()
Get the "http.maxRedirects" setting
|
int |
getPostBuffer()
Get the "http.postBuffer" setting
|
boolean |
getSaveCookies()
Get the "http.saveCookies" setting
|
private void |
init(Config config,
URIish uri) |
boolean |
isSslVerify()
Get the "http.sslVerify" setting
|
(package private) static java.lang.String |
normalize(java.lang.String path) |
(package private) static int |
segmentCompare(java.lang.String uriPath,
java.lang.String m) |
private static final org.slf4j.Logger LOG
private static final java.lang.String FTP
public static final java.lang.String HTTP
public static final java.lang.String FOLLOW_REDIRECTS_KEY
public static final java.lang.String MAX_REDIRECTS_KEY
public static final java.lang.String POST_BUFFER_KEY
public static final java.lang.String SSL_VERIFY_KEY
public static final java.lang.String COOKIE_FILE_KEY
public static final java.lang.String SAVE_COOKIES_KEY
public static final java.lang.String COOKIE_FILE_CACHE_LIMIT_KEY
private static final int DEFAULT_COOKIE_FILE_CACHE_LIMIT
private static final java.lang.String MAX_REDIRECT_SYSTEM_PROPERTY
private static final int DEFAULT_MAX_REDIRECTS
private static final int MAX_REDIRECTS
private int postBuffer
private boolean sslVerify
private HttpConfig.HttpRedirectMode followRedirects
private int maxRedirects
private java.lang.String cookieFile
private boolean saveCookies
private int cookieFileCacheLimit
public HttpConfig(Config config, URIish uri)
HttpConfig
tailored to
the given URIish
.config
- to read the HttpConfig
fromuri
- to get the configuration values forpublic HttpConfig(URIish uri)
HttpConfig
that reads values
solely from the user config.uri
- to get the configuration values forpublic int getPostBuffer()
public boolean isSslVerify()
public HttpConfig.HttpRedirectMode getFollowRedirects()
public int getMaxRedirects()
public java.lang.String getCookieFile()
public boolean getSaveCookies()
public int getCookieFileCacheLimit()
private java.lang.String findMatch(java.util.Set<java.lang.String> names, URIish uri)
URIish
.names
- to match against the uri
uri
- to find a match fornull
if no
subsection matchesprivate boolean compare(java.lang.String a, java.lang.String b)
private int defaultedPort(int port, java.lang.String scheme)
static int segmentCompare(java.lang.String uriPath, java.lang.String m)
static java.lang.String normalize(java.lang.String path)