Class AbstractHttpBoxClient

  • All Implemented Interfaces:
    BoxClient
    Direct Known Subclasses:
    HttpBoxClient

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

      • AbstractHttpBoxClient

        public AbstractHttpBoxClient​(URI uri)
        Creates a new client.
        Parameters:
        uri - the base uri of the box source (eg, http://localhost:8080/app/box)
    • Method Detail

      • collect

        public QueryResult collect​(BoxQuery query)
        Description copied from interface: BoxClient
        Collects and returns all documents found according to the given query.
        Specified by:
        collect in interface BoxClient
        Parameters:
        query - the query
        Returns:
        the results
      • getUri

        public URI getUri()
        Returns the base uri for the box.
        Returns:
        the uri
      • send

        protected abstract InputStream send​(URI uri)
        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.
        Parameters:
        uri - the full uri to send to box for the query
        Returns:
        the response body as an InputStream