public interface HttpConnection
HttpURLConnection
which is
used by JGitModifier and Type | Field and Description |
---|---|
static int |
HTTP_FORBIDDEN |
static int |
HTTP_MOVED_PERM |
static int |
HTTP_NOT_FOUND |
static int |
HTTP_OK |
static int |
HTTP_UNAUTHORIZED |
static final int HTTP_OK
HttpURLConnection.HTTP_OK
,
Constant Field Valuesstatic final int HTTP_MOVED_PERM
HttpURLConnection.HTTP_MOVED_PERM
,
Constant Field Valuesstatic final int HTTP_NOT_FOUND
static final int HTTP_UNAUTHORIZED
static final int HTTP_FORBIDDEN
int getResponseCode() throws IOException
IOException
HttpURLConnection.getResponseCode()
URL getURL()
URLConnection.getURL()
String getResponseMessage() throws IOException
null
IOException
HttpURLConnection.getResponseMessage()
Map<String,List<String>> getHeaderFields()
URLConnection.getHeaderFields()
void setRequestProperty(String key, String value)
key
- the keyword by which the request is known (e.g., "
Accept
").value
- the value associated with it.URLConnection.setRequestProperty(String, String)
void setRequestMethod(String method) throws ProtocolException
method
- the HTTP methodProtocolException
- if the method cannot be reset or if the requested method
isn't valid for HTTP.HttpURLConnection.setRequestMethod(String)
void setUseCaches(boolean usecaches)
usecaches
- a boolean
indicating whether or not to allow
cachingURLConnection.setUseCaches(boolean)
void setConnectTimeout(int timeout)
timeout
- an int
that specifies the connect timeout value
in millisecondsURLConnection.setConnectTimeout(int)
void setReadTimeout(int timeout)
timeout
- an int
that specifies the timeout value to be
used in millisecondsURLConnection.setReadTimeout(int)
String getContentType()
null
if not known.URLConnection.getContentType()
InputStream getInputStream() throws IOException
IOException
- if an I/O error occurs while creating the input stream.URLConnection.getInputStream()
String getHeaderField(String name)
name
- the name of a header field.null
if
there is no such field in the header.URLConnection.getHeaderField(String)
int getContentLength()
-1
if the content length is not known, or if
the content length is greater than Integer.MAX_VALUE.URLConnection.getContentLength()
void setInstanceFollowRedirects(boolean followRedirects)
followRedirects
- a boolean
indicating whether or not to follow
HTTP redirects.HttpURLConnection.setInstanceFollowRedirects(boolean)
void setDoOutput(boolean dooutput)
dooutput
- the new value.URLConnection.setDoOutput(boolean)
void setFixedLengthStreamingMode(int contentLength)
contentLength
- The number of bytes which will be written to the OutputStream.HttpURLConnection.setFixedLengthStreamingMode(int)
OutputStream getOutputStream() throws IOException
IOException
URLConnection.getOutputStream()
void setChunkedStreamingMode(int chunklen)
chunklen
- The number of bytes to write in each chunk. If chunklen is
less than or equal to zero, a default value will be used.HttpURLConnection.setChunkedStreamingMode(int)
String getRequestMethod()
HttpURLConnection.getRequestMethod()
boolean usingProxy()
HttpURLConnection.usingProxy()
void connect() throws IOException
IOException
URLConnection.connect()
void configure(KeyManager[] km, TrustManager[] tm, SecureRandom random) throws NoSuchAlgorithmException, KeyManagementException
km
- the keymanager managing the key material used to authenticate
the local SSLSocket to its peertm
- the trustmanager responsible for managing the trust material
that is used when making trust decisions, and for deciding
whether credentials presented by a peer should be accepted.random
- the source of randomness for this generator or null. See
SSLContext.init(KeyManager[], TrustManager[], SecureRandom)
NoSuchAlgorithmException
KeyManagementException
void setHostnameVerifier(HostnameVerifier hostnameverifier) throws NoSuchAlgorithmException, KeyManagementException
HostnameVerifier
used during https communicationhostnameverifier
- NoSuchAlgorithmException
KeyManagementException
Copyright © 2017 Eclipse JGit Project. All rights reserved.