Class HttpConfig

java.lang.Object
org.eclipse.jgit.transport.HttpConfig

public class HttpConfig extends Object
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
  • Field Details

    • LOG

      private static final org.slf4j.Logger LOG
    • FTP

      private static final String FTP
      See Also:
    • HTTP

      public static final String HTTP
      git config section key for http settings.
      See Also:
    • FOLLOW_REDIRECTS_KEY

      public static final String FOLLOW_REDIRECTS_KEY
      git config key for the "followRedirects" setting.
      See Also:
    • MAX_REDIRECTS_KEY

      public static final String MAX_REDIRECTS_KEY
      git config key for the "maxRedirects" setting.
      See Also:
    • POST_BUFFER_KEY

      public static final String POST_BUFFER_KEY
      git config key for the "postBuffer" setting.
      See Also:
    • SSL_VERIFY_KEY

      public static final String SSL_VERIFY_KEY
      git config key for the "sslVerify" setting.
      See Also:
    • USER_AGENT

      public static final String USER_AGENT
      git config key for the "userAgent" setting.
      Since:
      5.10
      See Also:
    • EXTRA_HEADER

      public static final String EXTRA_HEADER
      git config key for the "extraHeader" setting.
      Since:
      5.10
      See Also:
    • SAVE_COOKIES_KEY

      public static final String SAVE_COOKIES_KEY
      git config key for the "saveCookies" setting.
      Since:
      5.4
      See Also:
    • MAX_REDIRECT_SYSTEM_PROPERTY

      private static final String 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

      private static final String ENV_HTTP_USER_AGENT
      See Also:
    • postBuffer

      private int postBuffer
    • sslVerify

      private boolean sslVerify
    • followRedirects

      private HttpConfig.HttpRedirectMode followRedirects
    • maxRedirects

      private int maxRedirects
    • userAgent

      private String userAgent
    • extraHeaders

      private List<String> extraHeaders
    • cookieFile

      private String cookieFile
    • saveCookies

      private boolean saveCookies
    • cookieFileCacheLimit

      private int cookieFileCacheLimit
  • Constructor Details

    • HttpConfig

      public HttpConfig(Config config, URIish uri)
      Creates a new HttpConfig tailored to the given URIish.
      Parameters:
      config - to read the HttpConfig from
      uri - to get the configuration values for
    • HttpConfig

      public HttpConfig(URIish uri)
      Creates a HttpConfig that 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

      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
    • getUserAgent

      public String getUserAgent()
      Get the "http.userAgent" setting
      Returns:
      the value of the "http.userAgent" setting
      Since:
      5.10
    • getExtraHeaders

      @NonNull public List<String> getExtraHeaders()
      Get the "http.extraHeader" setting
      Returns:
      the value of the "http.extraHeader" setting
      Since:
      5.10
    • getCookieFile

      public 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
    • init

      private void init(Config config, URIish uri)
    • findLastEmpty

      private int findLastEmpty(String[] values)
    • findMatch

      private String findMatch(Set<String> names, URIish uri)
      Determines the best match from a set of subsection names (representing prefix URLs) for the given URIish.
      Parameters:
      names - to match against the uri
      uri - to find a match for
      Returns:
      the best matching subsection name, or null if no subsection matches
    • compare

      private boolean compare(String a, String b)
    • defaultedPort

      private int defaultedPort(int port, String scheme)
    • segmentCompare

      static int segmentCompare(String uriPath, String m)
    • normalize

      static String normalize(String path)