gov.llnl.babel.url
public class CookieConnection extends java.lang.Object
CookieConnection
caches cookies for a HTTP or HTTPS
connection. It provides methods to post and get data and maintains cookie
state.Constructor and Description |
---|
CookieConnection()
Create a new cookie connection and initialize the cookie state to be
empty.
|
Modifier and Type | Method and Description |
---|---|
java.io.InputStream |
getFromURL(java.lang.String url_string)
Open a GET connection to the specified URL and return the associated
input stream, which must be closed by the callee.
|
void |
postToURL(java.lang.String url_string,
java.lang.String content_type,
java.io.InputStream content)
Open a POST connection to the specified URL and submit the specified
input stream with the associated content type.
|
public CookieConnection()
public java.io.InputStream getFromURL(java.lang.String url_string) throws HttpException, java.io.IOException
IOException
is thrown if there is an I/O error or if
the status response from the HTTP server indicates an error.HttpException
java.io.IOException
public void postToURL(java.lang.String url_string, java.lang.String content_type, java.io.InputStream content) throws HttpException, java.io.IOException
IOException
is thrown if there is an I/O error or if the
status response from the HTTP server indicates an error. The content
stream is closed after its data is transferred to the server.HttpException
java.io.IOException