public class CurlHttpConnection
extends java.lang.Object
| Constructor and Description |
|---|
CurlHttpConnection(java.net.URL url,
java.lang.String username,
java.lang.String password) |
| Modifier and Type | Method and Description |
|---|---|
void |
authenticate()
Handles the authentication for this connection.
|
void |
authenticateImpl()
Handles the authentication for this connection.
|
void |
close() |
void |
connect(CurlResource curl)
Connects to the server.
|
static CurlHttpConnection |
createConnection(java.net.URL url,
java.lang.String username,
java.lang.String password,
CurlResource curl) |
static CurlHttpConnection |
createConnection(java.net.URL url,
java.lang.String username,
java.lang.String password,
CurlResource curl,
java.net.URL proxyURL,
java.lang.String proxyUsername,
java.lang.String proxyPassword,
java.lang.String proxyType) |
void |
disconnect() |
protected java.net.URLConnection |
getConnection() |
int |
getContentLength() |
java.io.InputStream |
getErrorStream() |
java.lang.String |
getHeaderField(int i) |
java.lang.String |
getHeaderField(java.lang.String key) |
java.lang.String |
getHeaderFieldKey(int i) |
protected java.net.HttpURLConnection |
getHttpConnection() |
java.io.InputStream |
getInputStream() |
java.io.OutputStream |
getOutputStream() |
protected java.net.Proxy |
getProxy() |
java.lang.String |
getRequestProperty(java.lang.String key) |
int |
getResponseCode() |
java.lang.String |
getResponseMessage() |
protected java.net.URL |
getURL() |
protected void |
init(CurlResource curl) |
protected void |
setConnection(java.net.URLConnection conn) |
void |
setConnectTimeout(int time) |
void |
setDoOutput(boolean doOutput) |
void |
setInstanceFollowRedirects(boolean isToFollowRedirects) |
void |
setReadTimeout(int time) |
void |
setRequestMethod(java.lang.String method) |
void |
setRequestProperty(java.lang.String key,
java.lang.String value) |
public CurlHttpConnection(java.net.URL url,
java.lang.String username,
java.lang.String password)
throws java.io.IOException
java.io.IOExceptionprotected void init(CurlResource curl) throws java.io.IOException
java.io.IOExceptionpublic static final CurlHttpConnection createConnection(java.net.URL url, java.lang.String username, java.lang.String password, CurlResource curl, java.net.URL proxyURL, java.lang.String proxyUsername, java.lang.String proxyPassword, java.lang.String proxyType) throws java.io.IOException
java.io.IOExceptionpublic static final CurlHttpConnection createConnection(java.net.URL url, java.lang.String username, java.lang.String password, CurlResource curl) throws java.io.IOException
java.io.IOExceptionpublic void setConnectTimeout(int time)
public void setDoOutput(boolean doOutput)
public void setInstanceFollowRedirects(boolean isToFollowRedirects)
public void setReadTimeout(int time)
public void setRequestMethod(java.lang.String method)
throws java.net.ProtocolException
java.net.ProtocolExceptionpublic java.lang.String getRequestProperty(java.lang.String key)
public void setRequestProperty(java.lang.String key,
java.lang.String value)
protected final java.net.Proxy getProxy()
protected final java.net.URL getURL()
protected final java.net.URLConnection getConnection()
protected final java.net.HttpURLConnection getHttpConnection()
protected final void setConnection(java.net.URLConnection conn)
public void connect(CurlResource curl) throws java.net.ConnectException, java.net.ProtocolException, java.net.SocketTimeoutException, java.io.IOException
java.net.ConnectExceptionjava.net.ProtocolExceptionjava.net.SocketTimeoutExceptionjava.io.IOExceptionpublic void authenticate()
throws java.net.ConnectException,
java.net.ProtocolException,
java.net.SocketTimeoutException,
java.io.IOException
java.net.ConnectExceptionjava.net.ProtocolExceptionjava.net.SocketTimeoutExceptionjava.io.IOExceptionpublic void authenticateImpl()
throws java.net.ConnectException,
java.net.ProtocolException,
java.net.SocketTimeoutException,
java.io.IOException
java.net.ConnectExceptionjava.net.ProtocolExceptionjava.net.SocketTimeoutExceptionjava.io.IOExceptionpublic int getContentLength()
public java.io.InputStream getErrorStream()
public java.lang.String getHeaderField(java.lang.String key)
public java.lang.String getHeaderField(int i)
public java.lang.String getHeaderFieldKey(int i)
public java.io.InputStream getInputStream()
throws java.io.IOException
java.io.IOExceptionpublic java.io.OutputStream getOutputStream()
throws java.io.IOException
java.io.IOExceptionpublic int getResponseCode()
throws java.io.IOException
java.io.IOExceptionpublic java.lang.String getResponseMessage()
throws java.io.IOException
java.io.IOExceptionpublic void disconnect()
public void close()