Class HttpBoxClient

  • All Implemented Interfaces:
    BoxClient

    public class HttpBoxClient
    extends AbstractHttpBoxClient
    A client for communicating with Box through it's web api.
    Author:
    Charles Draper
    • Constructor Detail

      • HttpBoxClient

        public HttpBoxClient​(URI uri)
        Creates a new HttpBoxClient with the given base uri. A new HttpClient 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 new HttpBoxClient 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

      • 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 class AbstractHttpBoxClient
        Parameters:
        uri - the full uri to send to box for the query
        Returns:
        the response body as an InputStream