If the transport is using HTTP and the remote HTTP service is Git-aware (speaks the "smart-http protocol") this client will automatically take advantage of the additional Git-specific HTTP extensions. If the remote service does not support these extensions, the client will degrade to direct file fetching.
If the remote (server side) repository does not have the specialized Git support, object files are retrieved directly through standard HTTP GET (or binary FTP GET) requests. This make it easy to serve a Git repository through a standard web host provider that does not offer specific support for Git.
WalkFetchConnection
| Modifier and Type | Class and Description |
|---|---|
| public static enum | TransportHttp.
Accept-Encoding header in the HTTP request (https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html). |
| private static class | |
| pack-priv class | |
| pack-priv class | TransportHttp.
Service for maintaining a single long-poll connection. |
| pack-priv class | TransportHttp.
State required to speak multiple HTTP requests with the remote. |
| pack-priv abstract class | TransportHttp.
Basic service for sending and receiving HTTP requests. |
| pack-priv class | |
| pack-priv class |
| Modifier and Type | Field and Description |
|---|---|
| private HttpAuthMethod | |
| private URL | |
| private final NetscapeCookieFile | cookieFile
All stored cookies bound to this repo (independent of the baseUrl) |
| private URIish | currentUri
The current URI we're talking to. |
| private HttpConnectionFactory | |
| private boolean | |
| private HttpConnectionFactory2. | |
| private Map | |
| private final HttpConfig | |
| private static final Logger | |
| private URL | |
| pack-priv static final TransportProtocol | |
| pack-priv static final TransportProtocol | |
| private final ProxySelector | |
| private final Set | relevantCookies
The cookies to be sent with each request to the given |
| private boolean | |
| private boolean | |
| private static final String | |
| private static final String | |
| private boolean | |
| private static final byte[] |
| Access | Constructor and Description |
|---|---|
| pack-priv | |
| pack-priv | TransportHttp(URIish
URI to create a HTTP transport for uri)Create a minimal HTTP transport with default configuration values. |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv static void | addHeaders(HttpConnection
The target HttpConnection conn, List<String> A list of header strings headersToAdd)Adds a list of header strings to the connection. |
| private HttpAuthMethod | |
| public void | close()
Implements abstract org. Implements java. Closes this resource, relinquishing any underlying resources. |
| private HttpConnection | |
| private HttpConnection | |
| private TransportHttp. | |
| private NoRemoteRepositoryException | |
| private List | |
| private static Set | |
| private static Set | Returns: only the cookies fromallCookies which are relevant (i.e.
are not expired, have a matching domain, have a matching path and
have a matching secure attribute)a list of cookies. allCookies, URL the url for which to filter the list of cookies. url)
|
| public Map | Returns: unmodifiable map of additional name:values that are set as headers on the HTTP connectionGet additional headers on the HTTP connection |
| private FetchConnection | getConnection(HttpConnection c, InputStream in, String service, Collection<RefSpec> refSpecs, String... additionalPatterns)
|
| private NetscapeCookieFile | |
| public HttpConnectionFactory | Returns: theHttpConnectionFactoryRetrieves the |
| private URL | |
| private void | |
| protected HttpConnection | Returns: the HTTP connectionHTTP request method method, URL url of the HTTP connection u, TransportHttp.accept-encoding header option acceptEncodingOpen an HTTP connection. |
| private boolean | |
| private boolean | |
| private boolean | |
| pack-priv static boolean | Returns: true if they domain-match; false if notthe host to compare against the cookieDomain host, String the domain to compare against cookieDomain)The utility method to check whether a host name is in a cookie's domain or not. |
| pack-priv static boolean | Returns: true if they path-match; false if notthe path to check path, String the cookie's path cookiePath)The utility method to check whether a path is matching a cookie path domain or not. |
| private WalkFetchConnection | |
| public FetchConnection | openFetch()
Implements abstract org. Begins a new connection for fetching from the remote repository. |
| public FetchConnection | openFetch(Collection<RefSpec>
that will be fetched via
refSpecs, String... FetchConnection#fetch(ProgressMonitor, Collection, java. laterthat will be set as ref prefixes if the server supports git
protocol V2; additionalPatterns)null values are ignoredOverrides org. Begins a new connection for fetching from the remote repository. |
| pack-priv final InputStream | |
| public PushConnection | openPush()
Implements abstract org. Begins a new connection for pushing into the remote repository. |
| pack-priv void | |
| private void | |
| private URIish | |
| public void | setAdditionalHeaders(Map<String, String>
a map of name:values that are to be set as headers on the HTTP
connection headers)Set additional headers on the HTTP connection |
| private void | |
| public void | setHttpConnectionFactory(HttpConnectionFactory
the customFactory)HttpConnectionFactory to useSets the |
| public void | setPreemptiveBasicAuthentication(String
to use username, String to use password)Sets preemptive Basic HTTP authentication. |
| protected void | setURI(URIish
a uri)org. object.Set uri a |
| public void | setUseSmartHttp(boolean
if on)true (default), smart HTTP is enabled.Toggle whether or not smart HTTP transport should be used. |
| private PushConnection | |
| private BufferedReader | |
| private URL | |
| private boolean | |
| private void | |
| private void | |
| pack-priv IOException |