Package edu.byu.hbll.box.client
Class HttpBoxClient
- java.lang.Object
-
- edu.byu.hbll.box.client.AbstractHttpBoxClient
-
- edu.byu.hbll.box.client.HttpBoxClient
-
- All Implemented Interfaces:
BoxClient
public class HttpBoxClient extends AbstractHttpBoxClient
A client for communicating with Box through it's web api.- Author:
- Charles Draper
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class edu.byu.hbll.box.client.AbstractHttpBoxClient
AbstractHttpBoxClient.QueryResponse
-
-
Constructor Summary
Constructors Constructor Description HttpBoxClient(URI uri)
Creates a newHttpBoxClient
with the given base uri.HttpBoxClient(URI uri, HttpClient client)
Creates a newHttpBoxClient
with the given base uri and client.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HttpClient
getClient()
Returns the underlyingHttpClient
.protected InputStream
send(URI uri)
Sends the request to the Box server and returns the response as an input stream.-
Methods inherited from class edu.byu.hbll.box.client.AbstractHttpBoxClient
collect, find, getUri
-
-
-
-
Constructor Detail
-
HttpBoxClient
public HttpBoxClient(URI uri)
Creates a newHttpBoxClient
with the given base uri. A newHttpClient
is used with default settings plus it always follows redirects.- Parameters:
uri
- the base uri of the box source (eg, http://localhost:8080/app/box)
-
HttpBoxClient
public HttpBoxClient(URI uri, HttpClient client)
Creates a newHttpBoxClient
with the given base uri and client.- Parameters:
uri
- the base uri of the box source (eg, http://localhost:8080/app/box)client
- http client to use
-
-
Method Detail
-
getClient
public HttpClient getClient()
Returns the underlyingHttpClient
.- Returns:
- the client
-
send
protected InputStream send(URI uri)
Description copied from class:AbstractHttpBoxClient
Sends the request to the Box server and returns the response as an input stream. This can be overridden by subclasses that require different HTTP clients. The input stream will be closed here.- Specified by:
send
in classAbstractHttpBoxClient
- Parameters:
uri
- the full uri to send to box for the query- Returns:
- the response body as an
InputStream
-
-