Package com.google.gdata.data.photos

Examples of com.google.gdata.data.photos.PhotoEntry


    AlbumEntry album = findAlbum(albumId);
    if (album == null) {
      throw new IllegalArgumentException(Messages.get("album_not_found",
          albumId));
    }
    PhotoEntry photo = new PhotoEntry();
    photo.setTitle(new PlainTextConstruct(name));
    MediaSource mediaSource = new MediaByteArraySource(data,
        MimeType.getContentTypeByExt(FolderUtil.getFileExt(name)));
    photo.setMediaSource(mediaSource);
    return getPicasawebService().insert(new URL(getPicasaURL(albumId)),
        photo);
  }
View Full Code Here


    } catch (MalformedURLException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }

    PhotoEntry myPhoto = new PhotoEntry();
    myPhoto.setClient("NinjaBlogger");

    MediaFileSource myMedia = new MediaFileSource(photo, mediaType);
    myPhoto.setMediaSource(myMedia);

    PhotoEntry returnedPhoto = null;
    try {
      returnedPhoto = service.insert(albumPostUrl, myPhoto);
    } catch (IOException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
View Full Code Here

        allFilesSent = true;
        continue;
      }
      File photo = new File(prefs.getFolderPath()+"\\"+photoName);
      String mediaType = new String("image/jpeg");
      PhotoEntry addedPhoto = picasaServiceHandler.uploadPhoto(album, photo, mediaType);
     
      String photoUrl = addedPhoto.getMediaThumbnails().get(0).getUrl();
      photoUrl = photoUrl.replaceAll("s72", "s640");

      String content = QuickPB.generateContent(photoUrl);
      String title = photoName.split(".jpg")[0];
      bloggerServiceHandler.createPost(prefs.getBlogId(), title, content);
View Full Code Here

    }
    return documentsService.insert(documentsFeedUri, newEntry);
  }

  public PhotoEntry uploadImage(byte[] mediaBytes, String mediaType, String imageName, String albumName) throws IOException, ServiceException {
    PhotoEntry myPhoto = new PhotoEntry();
    myPhoto.setTitle(new PlainTextConstruct(imageName));
    MediaByteArraySource myMedia = new MediaByteArraySource(mediaBytes, mediaType);
    myPhoto.setMediaSource(myMedia);
    AlbumEntry albumEntry = getAlbum(albumName);
    if (albumEntry != null) {
      return photoService.insert(new URL(((MediaContent) albumEntry.getContent()).getUri()), myPhoto);
    }
View Full Code Here

      }
    }
  }

  private void createPhoto(AlbumEntry albumEntry) throws Exception {
    PhotoEntry photo = new PhotoEntry();

    String title = getString("Title");
    photo.setTitle(new PlainTextConstruct(title));
    String description = getString("Description");
    photo.setDescription(new PlainTextConstruct(description));
    photo.setTimestamp(new Date());

    OtherContent content = new OtherContent();


    File file = null;
    while (file == null || !file.canRead()) {
      file = new File(getString("Photo location"));
    }
    content.setBytes(getBytes(file));
    content.setMimeType(new ContentType("image/jpeg"));
    photo.setContent(content);

    insert(albumEntry, photo);
  }
View Full Code Here

    return result;
  }

  private void showPhotoTags(AlbumEntry albumEntry, List<PhotoEntry> photos)
      throws Exception {
    PhotoEntry photoEntry;
    try {
      photoEntry = getEntry(photos, "photo");
    } catch (ExitException ee) {
      return;
    }
View Full Code Here

  }

  private void showPhotoComments(AlbumEntry albumEntry, List<PhotoEntry> photos)
      throws Exception {

    PhotoEntry photoEntry;
    try {
      photoEntry = getEntry(photos, "photo");
    } catch (ExitException ee) {
      return;
    }
View Full Code Here

TOP

Related Classes of com.google.gdata.data.photos.PhotoEntry

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.