Package org.opensocial

Examples of org.opensocial.RequestException


    }

    try {
      message.addRequiredParameters(accessor);
    } catch (OAuthException e) {
      throw new RequestException(
          "OAuth error thrown while signing request " + e.getMessage());
    } catch (java.net.URISyntaxException e) {
      throw new RequestException(
          "Malformed request URL " + message.URL + " could not be signed");
    }

    return HttpMessage.newRequest(message, ParameterStyle.QUERY_STRING);
  }
View Full Code Here


   *                          album_id property set
   */
  public static Request createMediaItem(MediaItem item) throws
      RequestException {
    if (item.getAlbumId() == null || item.getAlbumId().equals("")) {
      throw new RequestException("Passed MediaItem object does not have " +
          "album_id property set");
    }

    Request request = new Request(restTemplate, "mediaItems.create", "POST");
    request.addComponent(Request.ALBUM_ID, item.getAlbumId());
View Full Code Here

  }

  private static Request uploadMediaItem(MediaItem item, File content) throws
      RequestException, IOException {
    if (item.getAlbumId() == null || item.getAlbumId().equals("")) {
      throw new RequestException("Passed MediaItem object does not have " +
          "album_id property set");
    }
    if (item.getMimeType() == null || item.getMimeType().equals("")) {
      throw new RequestException("Passed MediaItem object does not have " +
          "mime_type property set");
    }

    Request request = new Request(restTemplate, "mediaItems.create", "POST");
    request.addComponent(Request.ALBUM_ID, item.getAlbumId());
View Full Code Here

   *                          id and album_id properties set
   */
  public static Request updateMediaItem(MediaItem item) throws
      RequestException {
    if (item.getId() == null || item.getId().equals("")) {
      throw new RequestException("Passed MediaItem object does not have id " +
          "property set");
    }
    if (item.getAlbumId() == null || item.getAlbumId().equals("")) {
      throw new RequestException("Passed MediaItem object does not have " +
          "album_id property set");
    }

    Request request = new Request(restTemplate, "mediaItems.update", "PUT");
    request.addComponent(Request.ALBUM_ID, item.getAlbumId());
View Full Code Here

   * @throws RequestException if the passed Album object does not have an id
   *                          property set
   */
  public static Request updateAlbum(Album album) throws RequestException {
    if (album.getId() == null || album.getId().equals("")) {
      throw new RequestException("Passed Album object does not have ID " +
          "property set");
    }

    Request request = new Request(restTemplate, "albums.update", "PUT");
    request.addComponent(Request.ALBUM_ID, album.getId());
View Full Code Here

TOP

Related Classes of org.opensocial.RequestException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.