Class AbstractHttpBoxClient

java.lang.Object
edu.byu.hbll.box.client.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 Details

    • 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 Details

    • 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
    • find

      public Iterable<BoxDocument> find(BoxQuery query)
      Description copied from interface: BoxClient
      Returns documents found according to the given query in the form of an Iterable.
      Specified by:
      find 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