Package com.caucho.hessian.client
Class HessianURLConnection
- java.lang.Object
-
- com.caucho.hessian.client.AbstractHessianConnection
-
- com.caucho.hessian.client.HessianURLConnection
-
- All Implemented Interfaces:
HessianConnection
public class HessianURLConnection extends AbstractHessianConnection
Internal connection to a server. The default connection is based on java.net
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddHeader(String key, String value)Adds a HTTP header.voidclose()Close/free the connectionvoiddestroy()Disconnect the connectionStringgetContentEncoding()Returns the content encodingInputStreamgetInputStream()Returns the InputStream to the resultOutputStreamgetOutputStream()Returns the output stream for the request.intgetStatusCode()Returns the status code.StringgetStatusMessage()Returns the status string.protected voidparseResponseHeaders(HttpURLConnection conn)voidsendRequest()Sends the request
-
-
-
Method Detail
-
addHeader
public void addHeader(String key, String value)
Adds a HTTP header.- Specified by:
addHeaderin interfaceHessianConnection- Overrides:
addHeaderin classAbstractHessianConnection
-
getOutputStream
public OutputStream getOutputStream() throws IOException
Returns the output stream for the request.- Specified by:
getOutputStreamin interfaceHessianConnection- Specified by:
getOutputStreamin classAbstractHessianConnection- Throws:
IOException
-
sendRequest
public void sendRequest() throws IOExceptionSends the request- Specified by:
sendRequestin interfaceHessianConnection- Specified by:
sendRequestin classAbstractHessianConnection- Throws:
IOException
-
parseResponseHeaders
protected void parseResponseHeaders(HttpURLConnection conn) throws IOException
- Throws:
IOException
-
getStatusCode
public int getStatusCode()
Returns the status code.- Specified by:
getStatusCodein interfaceHessianConnection- Specified by:
getStatusCodein classAbstractHessianConnection
-
getStatusMessage
public String getStatusMessage()
Returns the status string.- Specified by:
getStatusMessagein interfaceHessianConnection- Specified by:
getStatusMessagein classAbstractHessianConnection
-
getInputStream
public InputStream getInputStream() throws IOException
Returns the InputStream to the result- Specified by:
getInputStreamin interfaceHessianConnection- Specified by:
getInputStreamin classAbstractHessianConnection- Throws:
IOException
-
getContentEncoding
public String getContentEncoding()
Description copied from interface:HessianConnectionReturns the content encoding- Specified by:
getContentEncodingin interfaceHessianConnection- Overrides:
getContentEncodingin classAbstractHessianConnection
-
close
public void close()
Close/free the connection- Specified by:
closein interfaceHessianConnection- Overrides:
closein classAbstractHessianConnection
-
destroy
public void destroy()
Disconnect the connection- Specified by:
destroyin interfaceHessianConnection- Specified by:
destroyin classAbstractHessianConnection
-
-