Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.net.HttpURLConnection
org.apache.commons.httpclient.util.HttpURLConnection
public class HttpURLConnection
extends HttpURLConnection
HttpURLConnection
wrapper around HttpClient's
HttpMethod
. This allows existing code to easily switch to
HttpClieht without breaking existing interfaces using the JDK
HttpURLConnection
.
Note 1: The current implementations wraps only a connected
HttpMethod
, ie a method that has alreayd been used to connect
to an HTTP server.
Note 2: It is a best try effort as different version of the JDK have
different behaviours for HttpURLConnection
(And I'm not even
including the numerous HttpURLConnection
bugs!).
Constructor Summary | |
| |
|
Method Summary | |
void |
|
void |
|
boolean |
|
Object |
|
Object |
|
boolean |
|
boolean |
|
boolean |
|
InputStream |
|
String |
|
String |
|
String |
|
long |
|
InputStream |
|
boolean |
|
OutputStream | |
Permission |
|
String |
|
String |
|
int |
|
String |
|
URL |
|
boolean |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
boolean |
|
protected HttpURLConnection(URL url)
Create an instance.
- Parameters:
url
- The URL.
public HttpURLConnection(HttpMethod method, URL url)
Creates anHttpURLConnection
from aHttpMethod
.
- Parameters:
method
- the theMethod that was used to connect to the HTTP server and which contains the returned data.url
- the URL to which we are connected (includes query string)
public void connect() throws IOException
Not available: the data must have already been retrieved.
- See Also:
HttpURLConnection.connect()
public boolean getAllowUserInteraction()
Not yet implemented.
public Object getContent() throws IOException
Not yet implemented.
- See Also:
HttpURLConnection.getContent()
public Object getContent(Class[] classes) throws IOException
Not yet implemented.
public boolean getDefaultUseCaches()
Not available: the data must have already been retrieved.
public boolean getDoOutput()
Not yet implemented.
- See Also:
HttpURLConnection.getDoOutput()
public InputStream getErrorStream()
Not yet implemented. Return the error stream.
- See Also:
HttpURLConnection.getErrorStream()
public String getHeaderField(String name)
Return the header field
- Parameters:
name
- the name of the header
- Returns:
- the header field.
public String getHeaderField(int position)
Return the header field at the specified position
- Parameters:
position
- The position
- Returns:
- The header field.
public String getHeaderFieldKey(int keyPosition)
Return the header field key
- Parameters:
keyPosition
- The key position
- Returns:
- The header field key.
public long getIfModifiedSince()
Not yet implemented.
public InputStream getInputStream() throws IOException
Gets an input stream for the HttpMethod response body.
- Returns:
- The input stream.
public boolean getInstanceFollowRedirects()
Not yet implemented.
public OutputStream getOutputStream() throws IOException
- See Also:
HttpURLConnection.getOutputStream()
public Permission getPermission() throws IOException
Not yet implemented.
- See Also:
HttpURLConnection.getPermission()
public String getRequestMethod()
Return the request method.
- Returns:
- The request method.
public String getRequestProperty(String key)
Not yet implemented.
public int getResponseCode() throws IOException
Return the response code.
- Returns:
- The response code.
public String getResponseMessage() throws IOException
Return the response message
- Returns:
- The response message
public boolean getUseCaches()
Not yet implemented.
- See Also:
HttpURLConnection.getUseCaches()
public void setAllowUserInteraction(boolean isAllowInteraction)
Not available: the data must have already been retrieved.
public void setDefaultUseCaches(boolean isUsingCaches)
Not available: the data must have already been retrieved.
public void setDoInput(boolean isInput)
Not available: the data must have already been retrieved.
public void setDoOutput(boolean isOutput)
Not available: the data must have already been retrieved.
public void setIfModifiedSince(long modificationDate)
Not available: the data must have already been retrieved.
public void setInstanceFollowRedirects(boolean isFollowingRedirects)
Not available: the data must have already been retrieved.
public void setRequestMethod(String method) throws ProtocolException
Not available: the data must have already been retrieved.
public void setRequestProperty(String key, String value)
Not available: the data must have already been retrieved.
public void setUseCaches(boolean isUsingCaches)
Not available: the data must have already been retrieved.
public boolean usingProxy()
Not yet implemented.
- Returns:
- true if we are using a proxy.
- See Also:
HttpURLConnection.usingProxy()