public class CurlHttpRequest extends java.lang.Object implements EnvCleanup
Constructor and Description |
---|
CurlHttpRequest(CurlResource curlResource) |
Modifier and Type | Method and Description |
---|---|
void |
cleanup()
Cleanup resources associated with this connection.
|
protected void |
connect(Env env)
Attempt to connect to the server.
|
protected void |
create(Env env)
Opens the connection.
|
protected void |
error(Env env,
int code,
java.lang.String error) |
protected void |
error(Env env,
int code,
java.lang.String error,
java.lang.Throwable e) |
boolean |
execute(Env env)
Perform this request.
|
protected boolean |
finish(Env env)
Closes the connection and sends data and connection info to curl.
|
protected CurlResource |
getCurlResource() |
protected CurlHttpConnection |
getHttpConnection() |
static CurlHttpRequest |
getRequest(CurlResource curl)
Returns a HttpRequest specific to the Http request method.
|
protected java.net.URL |
getURL(Env env,
java.lang.String urlString,
int port)
Returns a valid URL or null on error.
|
protected boolean |
init(Env env)
Initializes the connection.
|
protected void |
transfer(Env env)
Transfer data to the server.
|
public CurlHttpRequest(CurlResource curlResource)
public static final CurlHttpRequest getRequest(CurlResource curl)
protected final void create(Env env) throws java.net.MalformedURLException, java.io.IOException
java.net.MalformedURLException
java.io.IOException
protected boolean init(Env env) throws java.net.ProtocolException
java.net.ProtocolException
protected void connect(Env env) throws java.net.ConnectException, java.net.SocketTimeoutException, java.net.UnknownHostException, java.io.IOException
java.net.ConnectException
java.net.SocketTimeoutException
java.net.UnknownHostException
java.io.IOException
protected void transfer(Env env) throws java.io.IOException
java.io.IOException
protected boolean finish(Env env) throws java.io.IOException
java.io.IOException
public final boolean execute(Env env)
protected final CurlResource getCurlResource()
protected final CurlHttpConnection getHttpConnection()
protected final void error(Env env, int code, java.lang.String error)
protected final void error(Env env, int code, java.lang.String error, java.lang.Throwable e)
protected final java.net.URL getURL(Env env, java.lang.String urlString, int port) throws java.net.MalformedURLException
java.net.MalformedURLException
public void cleanup()
cleanup
in interface EnvCleanup