org.modeshape.web.jcr.rest.client.http
Class HttpClientConnection
java.lang.Object
org.modeshape.web.jcr.rest.client.http.HttpClientConnection
public final class HttpClientConnection
- extends Object
HttpClientConnection
uses the Apache HttpClient
.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
HttpClientConnection
public HttpClientConnection(Server server,
URL url,
IJsonConstants.RequestMethod method)
throws Exception
- Parameters:
server
- the server with the host and port information (never null
)url
- the URL that will be used in the request (never null
)method
- the HTTP request method (never null
)
- Throws:
Exception
- if there is a problem establishing the connection
disconnect
public void disconnect()
- Disconnects this connection.
getResponseCode
public int getResponseCode()
throws Exception
- Returns:
- the HTTP response code
- Throws:
Exception
- if there is a problem getting the response code
read
public String read()
throws Exception
- Returns:
- the HTTP response body as a string
- Throws:
Exception
- if there is a problem reading from the connection
write
public void write(byte[] bytes)
throws Exception
- Parameters:
bytes
- the bytes being posted to the HTTP connection (never null
)
- Throws:
Exception
- if there is a problem writing to the connection
Copyright © 2008-2010 JBoss, a division of Red Hat. All Rights Reserved.