示例#1
0
    /**
     * Returns the text returned by the container after executing the passed
     * OpenSocialHttpRequest object.
     *
     * @param  r OpenSocialHttpRequest object to execute
     * @return
     * @throws OpenSocialRequestException if the status code returned by the
     *         container is not 200 OK.
     * @throws IOException
     */
    private String getHttpResponse(OpenSocialHttpRequest r)
    {
        if (r != null)
        {
            int requestStatus = r.execute();

            if (requestStatus == 200)
            {
                return(r.getResponseString());
            }
            else
            {
                throw new OpenSocialRequestException(
                          "Request returned error code: " + requestStatus);
            }
        }

        return(null);
    }
示例#2
0
  /**
   * Returns the text returned by the container after executing the passed
   * OpenSocialHttpRequest object. 
   * 
   * @param  r OpenSocialHttpRequest object to execute
   * @return
   * @throws OpenSocialRequestException if the status code returned by the
   *         container is not 200 OK.
   * @throws IOException
   */
  private String getHttpResponse(OpenSocialHttpRequest r)
    {

    if (r != null) {
      int requestStatus = r.execute();

      if (requestStatus == 200) {
        return r.getResponseString();
      } else {
        throw new OpenSocialRequestException(
            "Request returned error code: " + requestStatus);
      }
    }

    return null;
  }