Module org.eclipse.jgit.http.apache
Class HttpClientConnection
- java.lang.Object
-
- org.eclipse.jgit.transport.http.apache.HttpClientConnection
-
- All Implemented Interfaces:
HttpConnection
public class HttpClientConnection extends Object implements HttpConnection
AHttpConnectionwhich usesHttpClient- Since:
- 3.3
-
-
Field Summary
-
Fields inherited from interface org.eclipse.jgit.transport.http.HttpConnection
HTTP_11_MOVED_PERM, HTTP_11_MOVED_TEMP, HTTP_FORBIDDEN, HTTP_MOVED_PERM, HTTP_MOVED_TEMP, HTTP_NOT_AUTHORITATIVE, HTTP_NOT_FOUND, HTTP_OK, HTTP_SEE_OTHER, HTTP_UNAUTHORIZED
-
-
Constructor Summary
Constructors Constructor Description HttpClientConnection(String urlStr)Constructor for HttpClientConnection.HttpClientConnection(String urlStr, Proxy proxy)Constructor for HttpClientConnection.HttpClientConnection(String urlStr, Proxy proxy, org.apache.http.client.HttpClient cl)Constructor for HttpClientConnection.
-
Method Summary
-
-
-
Constructor Detail
-
HttpClientConnection
public HttpClientConnection(String urlStr) throws MalformedURLException
Constructor for HttpClientConnection.- Parameters:
urlStr-- Throws:
MalformedURLException
-
HttpClientConnection
public HttpClientConnection(String urlStr, Proxy proxy) throws MalformedURLException
Constructor for HttpClientConnection.- Parameters:
urlStr-proxy-- Throws:
MalformedURLException
-
HttpClientConnection
public HttpClientConnection(String urlStr, Proxy proxy, org.apache.http.client.HttpClient cl) throws MalformedURLException
Constructor for HttpClientConnection.- Parameters:
urlStr-proxy-cl-- Throws:
MalformedURLException
-
-
Method Detail
-
setBuffer
public void setBuffer(TemporaryBuffer buffer)
Sets the buffer from which to take the request body- Parameters:
buffer-
-
getResponseCode
public int getResponseCode() throws IOException- Specified by:
getResponseCodein interfaceHttpConnection- Throws:
IOException
-
getURL
public URL getURL()
- Specified by:
getURLin interfaceHttpConnection
-
getResponseMessage
public String getResponseMessage() throws IOException
- Specified by:
getResponseMessagein interfaceHttpConnection- Throws:
IOException
-
getHeaderFields
public Map<String,List<String>> getHeaderFields()
- Specified by:
getHeaderFieldsin interfaceHttpConnection
-
setRequestProperty
public void setRequestProperty(String name, String value)
- Specified by:
setRequestPropertyin interfaceHttpConnection
-
setRequestMethod
public void setRequestMethod(String method) throws ProtocolException
- Specified by:
setRequestMethodin interfaceHttpConnection- Throws:
ProtocolException
-
setUseCaches
public void setUseCaches(boolean usecaches)
- Specified by:
setUseCachesin interfaceHttpConnection
-
setConnectTimeout
public void setConnectTimeout(int timeout)
- Specified by:
setConnectTimeoutin interfaceHttpConnection
-
setReadTimeout
public void setReadTimeout(int readTimeout)
- Specified by:
setReadTimeoutin interfaceHttpConnection
-
getContentType
public String getContentType()
- Specified by:
getContentTypein interfaceHttpConnection
-
getInputStream
public InputStream getInputStream() throws IOException
- Specified by:
getInputStreamin interfaceHttpConnection- Throws:
IOException
-
getHeaderField
public String getHeaderField(@NonNull String name)
- Specified by:
getHeaderFieldin interfaceHttpConnection
-
getHeaderFields
public List<String> getHeaderFields(@NonNull String name)
- Specified by:
getHeaderFieldsin interfaceHttpConnection
-
getContentLength
public int getContentLength()
- Specified by:
getContentLengthin interfaceHttpConnection
-
setInstanceFollowRedirects
public void setInstanceFollowRedirects(boolean followRedirects)
- Specified by:
setInstanceFollowRedirectsin interfaceHttpConnection
-
setDoOutput
public void setDoOutput(boolean dooutput)
- Specified by:
setDoOutputin interfaceHttpConnection
-
setFixedLengthStreamingMode
public void setFixedLengthStreamingMode(int contentLength)
- Specified by:
setFixedLengthStreamingModein interfaceHttpConnection
-
getOutputStream
public OutputStream getOutputStream() throws IOException
- Specified by:
getOutputStreamin interfaceHttpConnection- Throws:
IOException
-
setChunkedStreamingMode
public void setChunkedStreamingMode(int chunklen)
- Specified by:
setChunkedStreamingModein interfaceHttpConnection
-
getRequestMethod
public String getRequestMethod()
- Specified by:
getRequestMethodin interfaceHttpConnection
-
usingProxy
public boolean usingProxy()
- Specified by:
usingProxyin interfaceHttpConnection
-
connect
public void connect() throws IOException- Specified by:
connectin interfaceHttpConnection- Throws:
IOException
-
setHostnameVerifier
public void setHostnameVerifier(HostnameVerifier hostnameverifier)
- Specified by:
setHostnameVerifierin interfaceHttpConnection
-
configure
public void configure(KeyManager[] km, TrustManager[] tm, SecureRandom random) throws KeyManagementException
- Specified by:
configurein interfaceHttpConnection- Throws:
KeyManagementException
-
-