Package api

Examples of api.KeyValuePair


  }

  private PicasaPhoto getPhoto(URL url) throws IOException, ParserConfigurationException, SAXException{
    HttpRequest httpRequest = new HttpRequest(url);
    if (this.picasaWeb.getGoogleapi() != null){
      KeyValuePair pair = this.picasaWeb.getGoogleapi().toAuthHeader();
      httpRequest.addHeader(pair.key, pair.value);
    }
    String response = httpRequest.send();
    Document document = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new InputSource(new StringReader(response)));
    return new PicasaPhoto(this, document.getDocumentElement());
View Full Code Here


   * @throws SAXException the response is not a parsable XML.
   */
  public PicasaPhoto[] listPhotos() throws IOException, ParserConfigurationException, SAXException{
    HttpRequest httpRequest = new HttpRequest(this.feedUrl);
    if (this.picasaWeb.getGoogleapi() != null){
      KeyValuePair pair = this.picasaWeb.getGoogleapi().toAuthHeader();
      httpRequest.addHeader(pair.key, pair.value);
    }
    String response = httpRequest.send();
    Document document = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new InputSource(new StringReader(response)));
    List<PicasaPhoto> picasaPhotos = new ArrayList<PicasaPhoto>();
View Full Code Here

  }

  public void delete() throws IOException{
    HttpRequest httpRequest = new HttpRequest(this.editUrl);
    if (this.picasaPhoto.getPicasaAlbum().getPicasaWeb().getGoogleapi() != null){
      KeyValuePair pair = this.picasaPhoto.getPicasaAlbum().getPicasaWeb().getGoogleapi().toAuthHeader();
      httpRequest.addHeader(pair.key, pair.value);
    }
    httpRequest.setMethod(HttpRequest.METHOD_DELETE);
    httpRequest.setContentType("application/atom+xml");
    String response = httpRequest.send();
View Full Code Here

TOP

Related Classes of api.KeyValuePair

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.